You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "zhangshenghang (via GitHub)" <gi...@apache.org> on 2026/09/21 10:01:09 UTC

[I] JDBC source cannot cancel in-flight queries during job cancellation [seatunnel]

zhangshenghang opened a new issue, #12419:
URL: https://github.com/apache/seatunnel/issues/12419

   ## Problem
   
   Cancelling a SeaTunnel Zeta job interrupts the task thread, but the JDBC source does not actively cancel the currently executing JDBC statement. If a JDBC driver blocks in executeQuery or ResultSet.next, the task cleanup and JDBC connection close can be delayed.
   
   ## Impact
   
   Long-running JDBC source queries may continue running after a user cancels the job, and the source connection may remain open until the JDBC call returns or the driver-specific timeout is reached.
   
   ## Expected behavior
   
   When a running job is cancelled, the JDBC source should actively cancel the current Statement, close the associated JDBC resources, and then complete the normal task cancellation lifecycle.
   
   ## Scope
   
   This issue covers a generic JDBC Source cancellation hook and a reproducible end-to-end test for an in-flight JDBC query. Database-specific driver behavior may still require vendor-specific validation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][Connector-V2][JDBC] Cannot cancel in-flight queries in JDBC source [seatunnel]

Posted by "nzw921rx (via GitHub)" <gi...@apache.org>.
nzw921rx closed issue #12419: [Bug][Connector-V2][JDBC] Cannot cancel in-flight queries in JDBC source
URL: https://github.com/apache/seatunnel/issues/12419


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][Connector-V2][JDBC] Cannot cancel in-flight queries in JDBC source [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #12419:
URL: https://github.com/apache/seatunnel/issues/12419#issuecomment-5760330454

   Classification: E / Connector-V2 JDBC source cancellation.
   
   Current `dev` confirms the gap. `JdbcSourceReader.close()` reaches `JdbcInputFormat.closeInputFormat()`, and `JdbcInputFormat` retains the active `PreparedStatement`; however, cleanup only closes the `ResultSet` and `Statement`. It never calls `Statement.cancel()`. If `executeQuery()` or `ResultSet.next()` is blocked, the close path can remain blocked behind the driver operation instead of actively asking the driver to stop it.
   
   I found no open PR for this path. A focused connector PR is appropriate, but please keep it independent of database-specific timeout defaults and do not add a new configuration option. It should safely publish/cancel the active statement before normal resource closure, tolerate drivers that reject or ignore `cancel()`, and preserve the existing transaction-cleanup order. Add a deterministic unit test for cancel-before-close and an integration regression using a supported driver with a deliberately in-flight query, asserting cancellation completion and resource cleanup. Please link the PR here first to keep one implementation path.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][Connector-V2][JDBC] Cannot cancel in-flight queries in JDBC source [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on issue #12419:
URL: https://github.com/apache/seatunnel/issues/12419#issuecomment-5771400726

   Thanks for the report. The gap is confirmed on current `dev`: `JdbcSourceReader.close()` reaches `JdbcInputFormat.closeInputFormat()`, which closes the `ResultSet` and `Statement` but never calls `Statement.cancel()`, so a driver blocked in `executeQuery()` or `ResultSet.next()` can hold up the close path.
   
   A focused connector PR is welcome. Please keep it scoped to the generic JDBC source cancellation hook in the `JdbcInputFormat` cleanup path: cancel the active statement before normal resource closure, tolerate drivers that reject or ignore `cancel()`, preserve the existing transaction-cleanup order, avoid database-specific timeout defaults, and do not add a new configuration option.
   
   For tests, add a deterministic unit test for cancel-before-close, plus an integration regression with a supported driver and a deliberately in-flight query that asserts cancellation completes and resources are cleaned up.
   
   Please link the PR here first so we keep a single implementation path.
   
   <!-- streview-comment:1239 -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org