-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 random sleep for noninteractive renewals #6393
Conversation
The testing for this is a little tricky because the tox tests cause |
Is this ready for a review? |
Hi @ohemorange, I'm working on this today—I think the functionality is right but the tests are a little tricky because currently all renewal tests are doing the random sleep which makes Travis take way too long to complete them. Hopefully the tests will be fixed up later today and then you could review it! |
I'm guessing the title change means it's ready for a review now? |
Yes please!
|
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.
The meat of it looks good!
@@ -1242,6 +1244,16 @@ def renew(config, unused_plugins): | |||
:rtype: None | |||
|
|||
""" | |||
if not sys.stdin.isatty(): |
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.
It's probably safer to put this down in main
the function, so we catch any subcommand that people might have put in their crontab.
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.
Per our chat discussion, maybe we can find out in Sumologic whether there are any load spikes that can be attributed to uses of certonly
(I suspect that they're all due to uses renew
). In our chat I pointed out that there might be other unattended uses for initial issuance (if people wrap Certbot with their own scripts) and so we might not want to introduce this delay across-the-board in order to avoid slowing down random scripted uses of Certbot that aren't related to renewals.
I mean, an extreme example could be if someone had set up some kind of unattended script that calls certbot certificates
in order to feed some sort of status monitor—it might be annoying to have this command take several minutes to execute! And since it doesn't interact with the CA at all, there's no resource-related reason to make it delay before running.
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.
I mean, an extreme example could be if someone had set up some kind of unattended script that calls
certbot certificates
in order to feed some sort of status monitor—it might be annoying to have this command take several minutes to execute! And since it doesn't interact with the CA at all, there's no resource-related reason to make it delay before running.
It does hit OCSP. (And, for certbot-auto, PyPI.)
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.
After checking the logs, looks like most of the spikiness comes from renew
s (not all! but a lot of it) so I'm cool keeping it here.
This is causing a problem in my renew script which doesn't use hooks, but instead turns of webserver runs certbot and then turns webserver back on. Meaning, sometimes the server is down for several minutes due to this change. Could you provide CLI argument to disable this. Or even better, might be good that it's not enabled by default. |
@filipkis, can your renew script be refactored to use hooks? If it currently looks like:
Then, you should be able to refactor that to:
|
Yes, it can and that's what I've done (after digging into the docs). Thank you for suggesting though. Might be useful to document this change somewhere else in case others stumble on the same issues. |
Fixes #6391.