-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat(jstzd): listen to os signals #686
Conversation
c259d03
to
797bb89
Compare
9b5966c
to
9fae526
Compare
Codecov ReportAttention: Patch coverage is
Continue to review full report in Codecov by Sentry.
|
b7a7a2a
to
620f38f
Compare
53b85d5
to
58fb599
Compare
620f38f
to
afc6f81
Compare
58fb599
to
8ba5015
Compare
afc6f81
to
cefaabc
Compare
8ba5015
to
1abf7cb
Compare
cefaabc
to
f69ed4b
Compare
1abf7cb
to
000c4e7
Compare
f69ed4b
to
a09fb96
Compare
000c4e7
to
fca59c9
Compare
a09fb96
to
27a422d
Compare
fca59c9
to
76a4947
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
For handling the SIGKILL, i'm thikning we could assgin subprocesses to the same process group as the parent?
if we could set the process group ID of the main server process to its own PID, and make sure all the octez tasks inherits it, when the jstzd server process is killed, it should clean up all the sub processses.
I found a crate nix where we can use unix specfic process management feature!
wdyt ? @huancheng-trili @zcabter
Killing the server process won't take down the entire process group. Child processes do have a new parent but they keep running in the same group. It's tricky because we don't have control over the octez executables and thus we cannot make them listen to anything relevant. (btw with the current setup octez process are already in the same process group as the server process.) If we want to guarantee that the sandbox is clean, we can use a container with everything running inside and create a wrapper server that handles path mapping and spawns the container, but that's a bit messy. For now we can probably just ignore this issue and deal with it later on. |
you are right here. i've done more digging into it and seems like we could set the |
27a422d
to
4fd53ec
Compare
We discussed potential solutions offline, namely requiring a sidecar process. I think we can put SIGKILL support on the backlog for now |
2da8de5
to
c7f9a1a
Compare
76a4947
to
a44e3cd
Compare
Context
Part of JSTZ-189.
JSTZ-189
Description
Terminate jstzd on SIGTERM and SIGINT.
Note that we still need to find a way to shut down all processes when SIGKILL hits the server process. What happens now is that the subprocesses become orphans after the server is terminated.
Manually testing the PR
default_config
with SIGTERM and added one test case with SIGINT