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 restartDeadTask logic when the task thread has died #861

Merged
merged 4 commits into from Nov 1, 2021

Conversation

surajkn
Copy link
Collaborator

@surajkn surajkn commented Oct 28, 2021

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

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
vmaheshw previously approved these changes Oct 28, 2021
Copy link
Collaborator

@vmaheshw vmaheshw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vmaheshw vmaheshw merged commit b8202b7 into linkedin:master 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
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.

None yet

3 participants