You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "zhang-arvin (via GitHub)" <gi...@apache.org> on 2026/09/07 17:35:53 UTC

Re: [PR] [Fix][Connector-V2] Fix MySQL sink connection leak and stale statement errors [seatunnel]

zhang-arvin commented on PR #11883:
URL: https://github.com/apache/seatunnel/pull/11883#issuecomment-5574008732

   @DanielLeens Thanks for your patience — you're right that the previous cycles were mostly rebase-only without substantive changes. I've now made the real fixes requested:
   
   1. **No-collector path now guarded (Issue 1)**: `write()` in the no-collector branch now captures the connection via `connectionProvider.getConnection()` and records it in `transactionConnection`, so a silent swap is detected. `close()` no longer calls `connection.commit()` directly — it reuses `commitIfNeeded()`, which throws when `transactionConnection` was swapped, instead of silently committing an empty replacement connection.
   
   2. **Fast path validates (Issue 2)**: `ConnectionPoolManager.getConnection()` no longer returns the cached connection after only an `isClosed()` check. The fast path now runs the same `isUsable()` validation (honoring `connectionTestQuery` / `isValid` with the pool's validation timeout) before returning the cached connection.
   
   3. Tests: `ConnectionPoolManagerTest` passes — 9 tests, 0 failures (`mvnw -pl seatunnel-connectors-v2/connector-jdbc -Dtest=ConnectionPoolManagerTest test`).
   
   Would you mind taking another look?


-- 
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