-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Removing task Id using remove() in TaskCancellationMonitoringService #15918
Merged
jainankitk
merged 1 commit into
opensearch-project:main
from
sgup432:task_cancellation_service
Sep 12, 2024
Merged
Removing task Id using remove() in TaskCancellationMonitoringService #15918
jainankitk
merged 1 commit into
opensearch-project:main
from
sgup432:task_cancellation_service
Sep 12, 2024
Conversation
This file contains 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
Signed-off-by: Sagar Upadhyaya <[email protected]>
sgup432
requested review from
anasalkouz,
andrross,
ashking94,
Bukhtawar,
CEHENKLE,
dblock,
dbwiddis,
gbbafna,
jainankitk,
kotwanikunal,
linuxpi,
mch2,
msfroh,
nknize,
owaiskazi19,
reta,
Rishikesh1159,
sachinpkale,
saratvemulapalli,
shwetathareja,
sohami and
VachaShah
as code owners
September 12, 2024 20:53
sgup432
changed the title
Removing task Id from map using remove() in TaskCancellationMonitoringService
Removing task Id remove() in TaskCancellationMonitoringService
Sep 12, 2024
jainankitk
approved these changes
Sep 12, 2024
sgup432
changed the title
Removing task Id remove() in TaskCancellationMonitoringService
Removing task Id using remove() in TaskCancellationMonitoringService
Sep 12, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15918 +/- ##
=========================================
Coverage 71.90% 71.90%
- Complexity 64216 64278 +62
=========================================
Files 5272 5277 +5
Lines 300597 300691 +94
Branches 43440 43449 +9
=========================================
+ Hits 216151 216225 +74
- Misses 66680 66707 +27
+ Partials 17766 17759 -7 ☔ View full report in Codecov by Sentry. |
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Sep 12, 2024
Signed-off-by: Sagar Upadhyaya <[email protected]> (cherry picked from commit 4223fab) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
jainankitk
pushed a commit
that referenced
this pull request
Sep 13, 2024
(cherry picked from commit 4223fab) Signed-off-by: Sagar Upadhyaya <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dk2k
pushed a commit
to dk2k/OpenSearch
that referenced
this pull request
Oct 16, 2024
Signed-off-by: Sagar Upadhyaya <[email protected]>
dk2k
pushed a commit
to dk2k/OpenSearch
that referenced
this pull request
Oct 17, 2024
Signed-off-by: Sagar Upadhyaya <[email protected]>
dk2k
pushed a commit
to dk2k/OpenSearch
that referenced
this pull request
Oct 21, 2024
Signed-off-by: Sagar Upadhyaya <[email protected]>
akolarkunnu
pushed a commit
to akolarkunnu/OpenSearch
that referenced
this pull request
Jan 21, 2025
Signed-off-by: Sagar Upadhyaya <[email protected]>
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.
Description
In TaskCancellationMonitoringService, we track long cancelled tasks via hashmap. Once they are completed, we remove such tasks from the tracker. To do so, earlier we used to traverse the whole entrySet, find the taskId and then remove it which is basically a O(n) operation and unnecessary. Changed it to use remove() directly.
As we saw in one occasion, if a domain is facing too many cancellations and tasks are not getting cleared up, this traversal might become heavy on CPU.
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
[ ] Public documentation issue/PR created, if applicable.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.