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
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.
...connector/src/main/java/com/linkedin/datastream/connectors/kafka/AbstractKafkaConnector.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
...java/com/linkedin/datastream/connectors/kafka/mirrormaker/KafkaMirrorMakerConnectorTask.java
Outdated
Show resolved
Hide resolved
…ck around task lock acquire
.../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
.../src/main/java/com/linkedin/datastream/connectors/kafka/AbstractKafkaBasedConnectorTask.java
Outdated
Show resolved
Hide resolved
* Fix restartDeadTask logic when the task thread has died
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