Skip to content

KAFKA-10340: Backport proactively close producer when cancelling source tasks#10238

Closed
rhauch wants to merge 1 commit intoapache:2.8from
rhauch:kafka-10340-2.8
Closed

KAFKA-10340: Backport proactively close producer when cancelling source tasks#10238
rhauch wants to merge 1 commit intoapache:2.8from
rhauch:kafka-10340-2.8

Conversation

@rhauch
Copy link
Copy Markdown
Contributor

@rhauch rhauch commented Mar 1, 2021

NOTE: This is targeted to the 2.8 branch (currently frozen), but includes the same commit cherry-picked from trunk and originating in #10016 for KAFKA-10340.

This should be merged only after this issue is approved as a blocker for 2.8.0, or after 2.8.0 is released. When it is merged, add "2.8.0" or "2.8.1" to the fix version for KAFKA-10340.

Close the producer in WorkerSourceTask when the latter is cancelled. If the broker do not autocreate the topic, and the connector is not configured to create topics written by the source connector, then the WorkerSourceTask main thread will block forever until the topic is created, and will not stop if cancelled or scheduled for shutdown by the worker.

Expanded an existing unit test for the WorkerSourceTask class to ensure that the producer is closed when the task is abandoned, and added a new integration test that guarantees that tasks are still shut down even when their producers are trying to write to topics that do not exist.

…pache#10016)

Close the producer in `WorkerSourceTask` when the latter is cancelled. If the broker do not autocreate the topic, and the connector is not configured to create topics written by the source connector, then the `WorkerSourceTask` main thread will block forever until the topic is created, and will not stop if cancelled or scheduled for shutdown by the worker.

Expanded an existing unit test for the WorkerSourceTask class to ensure that the producer is closed when the task is abandoned, and added a new integration test that guarantees that tasks are still shut down even when their producers are trying to write to topics that do not exist.

Author: Chris Egerton <chrise@confluent.io>
Reviewed: Greg Harris <gregh@confluent.io>, Randall Hauch <rhauch@gmail.com>
@rhauch rhauch added the connect label Mar 1, 2021
@rhauch rhauch changed the title KAFKA-10340: Proactively close producer when cancelling source tasks KAFKA-10340: Backport proactively close producer when cancelling source tasks Mar 1, 2021
@rhauch
Copy link
Copy Markdown
Contributor Author

rhauch commented May 5, 2021

Closed without merging. Instead, I cherry-picked the commit from #10016 to the 2.8 branch now that 2.8.0 is out.

@rhauch rhauch closed this May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants