Agent: fix incorrect waiting logic in the case when acquiring fails#10193
Merged
SpecLad merged 3 commits intocvat-ai:developfrom Jan 16, 2026
Merged
Agent: fix incorrect waiting logic in the case when acquiring fails#10193SpecLad merged 3 commits intocvat-ai:developfrom
SpecLad merged 3 commits intocvat-ai:developfrom
Conversation
The usage of `_wait_between_polls` here is incorrect. It waits for an AR to become available, but if we're in `_poll_for_ar`, that means an AR is already (potentially) available, and we just need to acquire it. If acquiring fails, we just need to wait a little for the server to recover, and then try again. `_wait_between_polls` can wait for wildly inappropriate amounts: * If there's already another pending AR, then it will return immediately, so `_poll_for_ar` will pound the server with acquire requests. * If there is no pending AR, then it can wait for up to 10 minutes, which is likely way more than the server would take to recover. So, remove `_wait_between_polls` here and replace it with a short sleep with exponential backoff.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #10193 +/- ##
===========================================
- Coverage 82.69% 75.84% -6.86%
===========================================
Files 481 430 -51
Lines 49520 46496 -3024
Branches 4166 4166
===========================================
- Hits 40949 35263 -5686
- Misses 8571 11233 +2662
🚀 New features to boost your workflow:
|
Merged
prathamesh-patil-5090
pushed a commit
to prathamesh-patil-5090/cvat
that referenced
this pull request
Jan 19, 2026
…vat-ai#10193) The usage of `_wait_between_polls` here is incorrect. It waits for an AR to become available, but if we're in `_poll_for_ar`, that means an AR is already (potentially) available, and we just need to acquire it. If acquiring fails, we just need to wait a little for the server to recover, and then try again. `_wait_between_polls` can wait for wildly inappropriate amounts: * If there's already another pending AR, then it will return immediately, so `_poll_for_ar` will pound the server with acquire requests. * If there is no pending AR, then it can wait for up to 10 minutes, which is likely way more than the server would take to recover. So, remove `_wait_between_polls` here and replace it with a short sleep with exponential backoff.
zoe-seo
pushed a commit
to AutoLabeling-dotdot/AutoLabelingTool
that referenced
this pull request
Jan 22, 2026
…vat-ai#10193) The usage of `_wait_between_polls` here is incorrect. It waits for an AR to become available, but if we're in `_poll_for_ar`, that means an AR is already (potentially) available, and we just need to acquire it. If acquiring fails, we just need to wait a little for the server to recover, and then try again. `_wait_between_polls` can wait for wildly inappropriate amounts: * If there's already another pending AR, then it will return immediately, so `_poll_for_ar` will pound the server with acquire requests. * If there is no pending AR, then it can wait for up to 10 minutes, which is likely way more than the server would take to recover. So, remove `_wait_between_polls` here and replace it with a short sleep with exponential backoff.
This file contains hidden or 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
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.



Motivation and context
The usage of
_wait_between_pollshere is incorrect. It waits for an AR to become available, but if we're in_poll_for_ar, that means an AR is already (potentially) available, and we just need to acquire it. If acquiring fails, we just need to wait a little for the server to recover, and then try again._wait_between_pollscan wait for wildly inappropriate amounts:If there's already another pending AR, then it will return immediately, so
_poll_for_arwill pound the server with acquire requests.If there is no pending AR, then it can wait for up to 10 minutes, which is likely way more than the server would take to recover.
So, remove
_wait_between_pollshere and replace it with a short sleep with exponential backoff.How has this been tested?
Manual testing.
Checklist
developbranch[ ] I have updated the documentation accordingly[ ] I have added tests to cover my changes[ ] I have linked related issues (see GitHub docs)License
Feel free to contact the maintainers if that's a concern.