-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Opt-in for additional meaningful exit-codes #5
Comments
Would we pair that with exposing things like timeouts and buries to the app via ENV vars? |
We could - do you think it would be necessary? |
Early thoughts: I'd rather avoid I'd rather avoid applying non-standard meaning to exit status codes. Zero and non-zero are about the only ones anybody can agree upon. What if It remains unix-style, and simple enough to not require library support in the worker, and doesn't involve overloading magic numbers. |
I don't have feelings one way or another and will follow @lox's lead. |
We discussed something similar - it's not exactly simpler than providing opt-in exit code behaviour, but it will get the job done. 👍 |
IMO that solution is WAY more complicated than simply assigning strategies to exit codes in invocation. |
I can't come up with a rational reason for disliking meaningful exit codes.
I should point out I'm responsible for exactly zero apps using cmdstalk, |
Yeah, perhaps you are right. I'm torn. I don't like burying application logic in command-line invocations. POSIX message queues would be fairly straight-forward: http://php.net/manual/en/function.msg-get-queue.php |
In handover we have some tasks that have various failure scenarios; sometimes it would be most appropriate to bury a task, other times it could be re-queued, maybe with a delay.
Currently cmdstalk is quite opinionated as to how to handle job failures, this one size fits all policy makes for a fine default, but it would be nice if cmdstalk supported some opt-in behaviour to allow the job command a little more control of the release strategy.
Exit codes are already meaningful, in that a non-zero code will cause cmdstalk to act based on it's opinion to either bury or release the task with a delay. With that in mind I propose allow that default behaviour to be extended, via additional args to cmdstalk, along the lines of:
cmdstalk -on-exit=255:BURY -on-exit=254:BACKOFF -on-exit=253:RELEASE ...
This would override the default cmdstalk exit code handling, which is still a valid use-case for when it is not possible to control the exit codes of the job command, with a more targeted approach that allows the job command input into what happens next.
Possible release / verbs would look something like (BURY, DELETE, RELEASE, BACKOFF) with backoff representing an (exponential) backoff strategy similar to cmdstalk's current default mode of operation.
The text was updated successfully, but these errors were encountered: