acme.certificate.create function returns before record removes have finished #31
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm running acme.js in a google function and wish to make sure that dns record removes have completed before the acme.js function completes.
Associated PR coolaj86/acme.js#30
Why?
What's the benefit or necessity of that?
Having the remove happen without consequence was intentional. If you use the
notify
callback you can catch the error and handle it that way, but I'm not aware of a use case where the rest of the process should be held up if the remove fails - it won't affect your ability to get a certificate, and it's not recoverable.What was happening that this caused an issue for you? (i.e. Were you getting API rate limit errors?)
How do you handle or resolve it?
I'll have to do a little more testing, but since I would be running the renewals in a Google Function, I wouldn't want the Google Function to return before the removes have been called and returned. I'm trying to avoid a bunch of orphaned DNS record entries.
I noticed when I was running locally that the main function would return, then the removes would complete which prompted me to do the initial investigation.
I did some very basic testing, but it seems the 'create' function is returning before the 'remove' functions have completed. I haven't dug too deeply in the code so I'm making a lot of assumptions, but since you said the design was intentional, then maybe I should be looking at just writing my own acme client and design it to run in a Google Function.
Does the Google Function forcefully exit before the event loop is clear?
Why does it think that you're code is "done" when it hasn't finished running yet?
Generally speaking node keeps running until you crash or
process.exit()
.I'd be happy to add the corresponding non-error
challenge_remove
event for success: https://git.coolaj86.com/coolaj86/acme.js/src/branch/master/acme.js#L784Can you make your application not exit until it gets that event?
(or do something like this, if you don't want to listen to events?)
I just don't a want slow and non-essential API requests to hold up the the entire pipeline.