-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add cancellation support in TransportGetAllocationStatsAction
#127371
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
base: main
Are you sure you want to change the base?
Conversation
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
Hi @JeremyDahlgren, I've created a changelog YAML for you. |
040b400
to
14918db
Compare
14918db
to
8d6f7cc
Compare
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.
My feeling is that there has to be a simpler way to achieve what we want than adding all this bare-handed locking etc. I would have expected something based on ref-counting would be neater: each waiting listener should hold a ref, releasing it on cancellation, and an ongoing computation stops early if the number of waiting refs drops to zero.
...ava/org/elasticsearch/action/admin/cluster/allocation/TransportGetAllocationStatsAction.java
Outdated
Show resolved
Hide resolved
...ava/org/elasticsearch/action/admin/cluster/allocation/TransportGetAllocationStatsAction.java
Outdated
Show resolved
Hide resolved
...ava/org/elasticsearch/action/admin/cluster/allocation/TransportGetAllocationStatsAction.java
Outdated
Show resolved
Hide resolved
I applied your suggested change to |
Replaces the use of a
SingleResultDeduplicator
by refactoring the cache as a subclass ofCancellableSingleObjectCache
. Refactored theAllocationStatsService
andNodeAllocationStatsAndWeightsCalculator
to accept theRunnable
used to test for cancellation.Closes #123248