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
[fix] Bree doesn't gracefully exit #242
Labels
bug
Something isn't working
Comments
I believe this is due to this https://github.com/breejs/bree/blob/master/src/index.js#L469 |
PR welcome + added test case would be great too 🙏 |
If I'm gonna be working on scheduler code, I'll write it from scratch and ditch Bree completely, tbh. I've been trying to avoid writing this code. |
Best of luck |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Node.js version: 20
OS version: n/a — happens on both mac and linux
Description:
When the main Bree process is terminated with
ctrl+c
(SIGINT), usinggraceful
, the worker process is told to terminate, which results in it exiting with a 1 exit code, even though it was terminated by the main process.This results in the
errorHandler
option receiving aWorker for job "BackgroundJob" exited with code 1
messageActual behavior
The logs printed during graceful termination look like the following (here I'm using pino with pino-pretty as the logger:
Expected behavior
Bree should be aware that it requested the job to terminate, and therefore not treat this exit code of 1 as an error, i.e., it should actually gracefully shut down.
Per the node.js Worker documentation:
Code to reproduce
It doesn't matter what "BackgroundJob" actually does.
Checklist
The text was updated successfully, but these errors were encountered: