Martijn Visser created FLINK-41815:
--------------------------------------
Summary: Exactly-once JdbcWriter#close leaves the flush timer
running and can still throw
Key: FLINK-41815
URL: https://issues.apache.org/jira/browse/FLINK-41815
Project: Flink
Issue Type: Bug
Components: Connectors / JDBC
Reporter: Martijn Visser
With `DeliveryGuarantee.EXACTLY_ONCE` and a batch interval set,
`JdbcWriter#close` closes the XA transaction but never the `JdbcOutputFormat`,
so its `jdbc-upsert-output-format` scheduler keeps flushing after the task is
gone. With PostgreSQL 16 on Flink 2.3.0, two of those threads were still
running 5 s after a cancel, one per task attempt, on main and with FLINK-41805.
Since FLINK-38180 a failing cleanup stops the TaskManager on the grounds that a
background thread left behind is not safe. The writer should stop the scheduler
on close in exactly-once mode as well, without closing the connection the
transaction runs on.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)