Unref timers
See original GitHub issueIssue Description
I’m using Cockatiel to renew cryptographic keys from service A, in the background of service B. Service B also runs a server.
The retry and timeout policies (and, presumably, the circuit breaker, but I can’t immediately see how this works) create timer objects. These keep the Node.js process alive.
Since I’m renewing keys in the background I’d rather the timers be unreferenced. This way, my process can shut down gracefully when the server is closed.
Currently if a renewal is stuck in a retry delay (or presumably a circuit breaker delay) my process won’t shut down.
We could address this by adding an unref
option in the policy creation arguments. It should default to false
, which would be the current behavior, but if set to true
it would ensure all timers are unreferenced.
Let me know if this is something you’d like and I can submit a PR.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
I’ll try and get some PRs done on Monday.
Okay. Let me know there’s actions to take on this issue, feel free to close it otherwise 🙂
I should get some diagrams in the docs to help with that. I’ve been sort of directing people to the Polly wiki for more in-depth info, but that’s an extra hop that not everyone will make/notice.