Skip to content

Refactor Stopping Tasks On Assignment Change of Tasks#868

Merged
shrinandthakkar merged 1 commit intolinkedin:masterfrom
shrinandthakkar:refactorStoppingTasksOnAssignmentChange
Apr 12, 2022
Merged

Refactor Stopping Tasks On Assignment Change of Tasks#868
shrinandthakkar merged 1 commit intolinkedin:masterfrom
shrinandthakkar:refactorStoppingTasksOnAssignmentChange

Conversation

@shrinandthakkar
Copy link
Copy Markdown
Collaborator

@shrinandthakkar shrinandthakkar commented Nov 11, 2021

Only trigger stopping for the tasks that need to be canceled per assignment change in the onAssignmentChange function. This change prevents calling stops on tasks recurrently in case of frequent assignment change triggers.


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

vmaheshw
vmaheshw previously approved these changes Nov 18, 2021
vmaheshw
vmaheshw previously approved these changes Dec 6, 2021
Copy link
Copy Markdown
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.

Thank you for fixing this.

Copy link
Copy Markdown
Collaborator

@surajkn surajkn left a comment

Choose a reason for hiding this comment

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

So the main objective of the change is to not call stop one more time while a current stop attempt is in progress. Correct?
Is yes I think that is still possible since in "restartDeadTask" we still call "stopUnassignedTasks" which calls "scheduleTasksToStop" with "_tasksPendingStop"

@shrinandthakkar
Copy link
Copy Markdown
Collaborator Author

shrinandthakkar commented Mar 3, 2022

So the main objective of the change is to not call stop one more time while a current stop attempt is in progress. Correct? Is yes I think that is still possible since in "restartDeadTask" we still call "stopUnassignedTasks" which calls "scheduleTasksToStop" with "_tasksPendingStop"

@surajkn Actually, the main objective of this change is to separate the two triggers of stopping the tasks. We want to avoid stopping the long-pending tasks whenever onAssignmentChange is invoked. We only want to trigger stop for the running tasks which are not part of the new assignment when the onAssignmentChange is called.

Those long-pending tasks could still be re-triggered for stopping periodically from the restartDeadTask function, which should be the expected behavior I think.

vmaheshw
vmaheshw previously approved these changes Apr 11, 2022
surajkn
surajkn previously approved these changes Apr 11, 2022
@shrinandthakkar shrinandthakkar dismissed stale reviews from surajkn and vmaheshw via 8ffb739 April 11, 2022 21:12
@shrinandthakkar shrinandthakkar force-pushed the refactorStoppingTasksOnAssignmentChange branch from 8ffb739 to e2938f0 Compare April 11, 2022 21:15
@vmaheshw vmaheshw self-requested a review April 12, 2022 21:07
@shrinandthakkar shrinandthakkar merged commit 4f806ac into linkedin:master Apr 12, 2022
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.

3 participants