Skip to content
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

Gracefully terminate tool daemons when obot exits #1536

Open
njhale opened this issue Jan 30, 2025 · 1 comment
Open

Gracefully terminate tool daemons when obot exits #1536

njhale opened this issue Jan 30, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@njhale
Copy link
Member

njhale commented Jan 30, 2025

Problem

When obot server is terminated with SIGINT (kill -2 <obot-server-pid>), it's child daemon tool processes are never terminated.

This isn't great. For example, it effectively prevents developers from stopping obot server Goland/delve debug sessions without killing the daemon tool processes directly.

Solution

Ensure that obot server properly propagates termination signals (like SIGINT) to the daemon tool processes it starts before exiting.

Fix Verification Gotchas

Running Ctrl-C from a common shell -- like bash and zsh -- sends SIGINT to the entire foreground process group, which includes the tool daemons started by obot server. This bypasses the graceful shutdown logic in Obot/GPTScript and means that it can't be used to effectively verify a fix.

Instead, any fix should be verified by executing kill -2 <obot-server-pid>, which will send SIGINT to only the parent obot server process.

@njhale njhale added the bug Something isn't working label Jan 30, 2025
@njhale njhale self-assigned this Jan 30, 2025
@njhale
Copy link
Member Author

njhale commented Jan 30, 2025

Setting this to medium because this has no immediate impact on Obot's functional features; i.e. it's pretty much only an issue during development (debugging).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant