-
Notifications
You must be signed in to change notification settings - Fork 192
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
Sync: Try to fix the GitHub abuse mechanism coping code #978
Conversation
* Fixes main bug that the default value for the Retry-After header was an int and not a str * Make the default wait random, between 10 - 60 seconds * Some tweaks, print the headers in more log messages, make them prettier. Fixes nf-core#970
Codecov Report
@@ Coverage Diff @@
## dev #978 +/- ##
==========================================
- Coverage 69.27% 69.21% -0.06%
==========================================
Files 34 34
Lines 4250 4256 +6
==========================================
+ Hits 2944 2946 +2
- Misses 1306 1310 +4
Continue to review full report at Codecov.
|
Started writing new tests for this but struggled, as if it's working it just sits in a |
Hmm maybe we just set a maximum number of tries instead of a For instance, could say try maximum 10 times and if it didn't work the first 5 times, then wait for 2h or so. We assign random slots to the sync jobs, which we sample uniformly. So we would have slots 5, 10, 15, 20, ... mins after calling the job. This way the jobs should be spread more or less evenly among the time slots and wouldn't run all at once. But maybe that's a bit too complicated and we just try again until it works 😁 |
That's sort of what I did here, right? Except with a random number of seconds, maximum one minute. I don't expect that we will need such a large delay between calls to be honest - the example in the docs suggests that the header might say to wait 30 seconds. I think that's more the order of magnitude. The 403 error code is fairly specific and the actions job will eventually time out after 6 hours (??) or so anyway. |
Hmm yeah you're right probably that's enough 👍 |
And hopefully GitHub will tell us how long to wait in the return header anyway, which would be the best way to do it. I wasn't able to test that without abusing GitHub myself, so we'll have to just see... Happy to merge if you can give a ✅ 😄 |
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.
👌
Fixes #970
PR checklist
CHANGELOG.md
is updateddocs
is updated