2 Replies Latest reply on Oct 20, 2015 3:47 PM by fox123

    Queries are not killed even if the client sends a cancel request

    fox123

      Hi all,

       

      I am experiencing a problem when I try to cancel a query that is processed locally in Teiid. For example, if I run a query like this:

      WITH x as (
        SELECT * FROM SYS.COLUMNS LIMIT 70
      ), y as (
        SELECT * FROM SYS.COLUMNS LIMIT 6
      )
      SELECT COUNT(*)
      FROM
        x as x1,
        x as x2,
        x as x3,
        x as x4,
        y as y1
      

       

      it is normally executed in around 20 seconds.

      If I try to cancel this query from a JDBC client, the cancel request is correctly sent to the server and in fact I can see this message in the log:

       

      19:37:57,544 INFO  [org.teiid.COMMAND_LOG] (New I/O worker #2) szgJ/5Ahjzdd     CANCEL USER COMMAND:    endTime=2015-10-20 19:37:57.544 requestID=szgJ/5Ahjzdd.16     txID=null       sessionID=szgJ/5Ahjzdd  principal=user@teiid-security   vdbName=test    vdbVersion=1    finalRowCount=null
      

       

      but the query actually continues to run for 20 seconds and it is not killed.

      The behavior is the same if the query is not based on SYS tables.

       

      On the other side, it seems that the query is correctly and immediately cancelled if the query is completely pushed down to an underlying datasource.

       

      Is it a normal behavior (maybe depending on the client) or is it an issue with the server?