Skip to content
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

Add a pause when only retries are in the queue #636

Merged
merged 2 commits into from Jul 30, 2020

Conversation

ianco
Copy link
Member

@ianco ianco commented Jul 29, 2020

Signed-off-by: Ian Costanzo ian@anon-solutions.ca

Added a sleep() when there are only retries in the queue.

Was causing problems with aries-vcr on startup - when the request was sent to establish a self-connection, aca-py was hogging cpu and preventing the aries-vcr startup from continuing; aries-vcr was unable to respond to callbacks until aca-py retries had all failed and timed out.

Signed-off-by: Ian Costanzo <ian@anon-solutions.ca>
@codecov-commenter
Copy link

Codecov Report

Merging #636 into master will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #636      +/-   ##
==========================================
- Coverage   97.51%   97.50%   -0.02%     
==========================================
  Files         250      250              
  Lines       13345    13347       +2     
==========================================
  Hits        13014    13014              
- Misses        331      333       +2     

@nrempel
Copy link
Contributor

nrempel commented Jul 29, 2020

Good catch. await asyncio.sleep(0) should (I think?) have essentially the same effect and avoid the use of magic numbers. But perhaps we want a slightly longer delay in any case.

@ianco
Copy link
Member Author

ianco commented Jul 30, 2020

Good catch. await asyncio.sleep(0) should (I think?) have essentially the same effect and avoid the use of magic numbers. But perhaps we want a slightly longer delay in any case.

I think sleep(0.05) is ok, a short delay doesn't hurt (the retry interval is much longer anyways), and the magic number is used in other delays elsewhere in aca-py

@andrewwhitehead andrewwhitehead merged commit 16dba72 into hyperledger:master Jul 30, 2020
@ianco ianco deleted the queue_retry_fix branch December 2, 2020 18:51
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.

None yet

4 participants