Fix restartDeadTask logic when the task thread has died#861
Merged
vmaheshw merged 4 commits intolinkedin:masterfrom Nov 1, 2021
Merged
Fix restartDeadTask logic when the task thread has died#861vmaheshw merged 4 commits intolinkedin:masterfrom
vmaheshw merged 4 commits intolinkedin:masterfrom
Conversation
In restartDeadTask we check if a task is dead and attempt to cleanly stop the task before restarting the task again. To check if the task is dead or not, one of the things we check is if the task thread is alive or not. Even though this is a correct check, we don't need to attempt to stop the task in this case as the task thread is already dead. Another fix is in KafkaMirrorMakerConnectorTask to count down the latch in case we fail to acquire the task lock.
vmaheshw
reviewed
Oct 28, 2021
...connector/src/main/java/com/linkedin/datastream/connectors/kafka/AbstractKafkaConnector.java
Outdated
Show resolved
Hide resolved
vmaheshw
previously approved these changes
Oct 28, 2021
Collaborator
vmaheshw
left a comment
There was a problem hiding this comment.
Plz add additional details in the description about the issue you are trying to fix and what are the symptoms of the problem. Add additional detail of why you are adding fix in KafkaMirrorMakerConnectorTask. What was the missing piece in KafkaMirrorMakerConnectorTask that caused availability issue.
...java/com/linkedin/datastream/connectors/kafka/mirrormaker/KafkaMirrorMakerConnectorTask.java
Outdated
Show resolved
Hide resolved
…ck around task lock acquire
vmaheshw
reviewed
Oct 28, 2021
.../src/main/java/com/linkedin/datastream/connectors/kafka/AbstractKafkaBasedConnectorTask.java
Outdated
Show resolved
Hide resolved
...java/com/linkedin/datastream/connectors/kafka/mirrormaker/KafkaMirrorMakerConnectorTask.java
Outdated
Show resolved
Hide resolved
…rrorMakerConnectorTask
vmaheshw
reviewed
Nov 1, 2021
.../src/main/java/com/linkedin/datastream/connectors/kafka/AbstractKafkaBasedConnectorTask.java
Outdated
Show resolved
Hide resolved
vmaheshw
approved these changes
Nov 1, 2021
jzakaryan
approved these changes
Nov 1, 2021
vmaheshw
pushed a commit
to vmaheshw/brooklin
that referenced
this pull request
Mar 1, 2022
* Fix restartDeadTask logic when the task thread has died
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In restartDeadTask we check if a task is dead and attempt to cleanly stop the task before restarting
the task again. To check if the task is dead or not, one of the things we check is if the task
thread is alive or not. Even though this is a correct check, we don't need to attempt to stop the
task in this case as the task thread is already dead.
Another fix is in KafkaMirrorMakerConnectorTask to count down the latch in case we fail to acquire
the task lock. The bug is, that if the task thread fails to acquire the lock and exits with the exception
the latch count is not reduced to 0 and in the next period restartDeadTask check the connector
thinks that the task has not yet stopped and continues to retry stopTask.
A scenario in which the above can happen is, when a task gets reassigned to a different host and
the task thread in the new host fails to acquire the lock because the previous has still not fully
stopped and released the task lock. This may happen when there are a huge number of tasks
being reassigned.
Important: DO NOT REPORT SECURITY ISSUES DIRECTLY ON GITHUB.
For reporting security issues and contributing security fixes,
please, email security@linkedin.com instead, as described in
the contribution guidelines.
Please, take a minute to review the contribution guidelines at:
https://github.com/linkedin/Brooklin/blob/master/CONTRIBUTING.md