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

오픈
opened 2020-04-14 00:54:35 +00:00 by Ghost · 5개의 코멘트

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.
"로그인하여 이 대화에 참여"
레이블 없음
마일스톤 없음
담당자 없음
참여자 2명
알림
마감일
기한이 올바르지 않거나 범위를 벗어났습니다. 'yyyy-mm-dd'형식을 사용해주십시오.

마감일이 설정되지 않았습니다.

의존성

No dependencies set.

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