puppetlabs / trapperkeeper

A services framework for Clojure / JVM applications.
https://tickets.puppetlabs.com/browse/TK
Apache License 2.0
587 stars 74 forks source link

(TK-487) Allow friendly init/start fail fast via ::exit throw #289

Open rbrw opened 4 years ago

rbrw commented 4 years ago

Allow init and start methods to throw a request-shutdown style ex-info map to short circuit the startup process and exit with a specified message and status, rather than a backtrace.

This just provides a short circuiting (immediate) counterpart to the existing, deferred shutdown requests provided by request-shutdown.

rbrw commented 4 years ago

This isn't quite ready (e.g. at least needs tests), but I wanted to see if it seemed plausible before proceeding further. The current motivation is wanting to be able to shut down in a friendly way when a service detects a problem with the configuration it retrieves via (get-config), without having to carefully coordinate with all other services in order to safely rely on a deferred request-shtudown.

puppetcla commented 4 years ago

CLA signed by all contributors.

CLAassistant commented 3 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.