acme.certificate.create function returns before record removes have finished #31

開啟中
opened 2020-04-14 00:54:35 +00:00 by Ghost · 5 comment

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

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 https://git.coolaj86.com/coolaj86/acme.js/pulls/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?

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?
Author

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'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.
Author

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.

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().

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#L784

Can 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?)

return new Promise(function () {
  setTimeout(resolve, 100)
})

I just don't a want slow and non-essential API requests to hold up the the entire pipeline.

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#L784 Can 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?) ``` return new Promise(function () { setTimeout(resolve, 100) }) ``` I just don't a want slow and non-essential API requests to hold up the the entire pipeline.
登入 才能加入這對話。
未選擇標籤
未選擇里程碑
No Assignees
2 參與者
訊息
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coolaj86/acme.js-ARCHIVED#31
No description provided.