Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adapt source task shutdown logic to work with newer versions of … #334

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

C0urante
Copy link
Contributor

@C0urante C0urante commented Jun 6, 2024

Kafka Connect underwent a change in its shutdown logic for source tasks around version 2.6.2 that caused SourceTask::stop to only be invoked after any in-progress calls to SourceTask::poll had returned; see KAFKA-15090 for more detail.

As a result, when running the source connector in these newer runtimes, a resource leak may occur where database connections are never closed.

This PR changes the shutdown logic in SourceTask::stop to:

  • Wait for any in-progress calls to SourceTask::poll to complete (in order to handle the possibility that the connector has been deployed onto an older runtime)
  • Release all resources originally allocated for the task

In addition, all resource release logic at the end of SourceTask::poll has been removed in favor of the logic added to SourceTask::stop.

@C0urante C0urante requested review from a team as code owners June 6, 2024 19:39
@jjaakola-aiven jjaakola-aiven merged commit 667202b into Aiven-Open:master Jun 7, 2024
3 checks passed
@C0urante C0urante deleted the kafka-15090-fix branch June 10, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants