Skip to content

feat: watch for sigterm for graceful teardown - #35

Merged
InftyAI-Agent merged 3 commits into
InftyAI:mainfrom
kerthcet:feat/watch-signal
Aug 3, 2026
Merged

feat: watch for sigterm for graceful teardown#35
InftyAI-Agent merged 3 commits into
InftyAI:mainfrom
kerthcet:feat/watch-signal

Conversation

@kerthcet

@kerthcet kerthcet commented Aug 3, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it

Which issue(s) this PR fixes

Fixes #

Special notes for your reviewer

Does this PR introduce a user-facing change?


Signed-off-by: kerthcet <kerthcet@gmail.com>
Signed-off-by: kerthcet <kerthcet@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 16:25
@InftyAI-Agent InftyAI-Agent added needs-triage Indicates an issue or PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. do-not-merge/needs-kind Indicates a PR lacks a label and requires one. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds graceful termination handling to the sandd daemon so it can react to SIGTERM/SIGINT by sending a WebSocket Close frame and exiting instead of reconnecting, enabling faster deregistration during pod/container shutdown.

Changes:

  • Introduces ServeOutcome and a shutdown_signal() helper to distinguish shutdown vs disconnect behavior.
  • Updates the serve loop to race inbound WebSocket processing with a shutdown future and send a Close frame on shutdown.
  • Adds shutdown-focused tests and includes libc as a dev-dependency for unix self-signal testing.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
sandd/src/main.rs Adds shutdown signal handling, updates reconnect/serve behavior, and introduces shutdown tests.
sandd/Cargo.toml Adds libc as a dev-dependency for unix shutdown signal testing.
Cargo.lock Locks libc dependency addition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sandd/src/main.rs
Comment thread sandd/src/main.rs Outdated
Comment thread sandd/src/main.rs Outdated
Signed-off-by: kerthcet <kerthcet@gmail.com>
@kerthcet

kerthcet commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

/lgtm
/approve
/kind feature

@InftyAI-Agent InftyAI-Agent added lgtm Looks good to me, indicates that a PR is ready to be merged. feature Categorizes issue or PR as related to a new feature. and removed do-not-merge/needs-kind Indicates a PR lacks a label and requires one. labels Aug 3, 2026

@InftyAI-Agent InftyAI-Agent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: PR has both lgtm and approved labels

@InftyAI-Agent InftyAI-Agent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: PR has both lgtm and approved labels

@InftyAI-Agent
InftyAI-Agent merged commit 1ec76d8 into InftyAI:main Aug 3, 2026
23 of 24 checks passed
@kerthcet
kerthcet deleted the feat/watch-signal branch August 3, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. feature Categorizes issue or PR as related to a new feature. lgtm Looks good to me, indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a label and requires one. needs-triage Indicates an issue or PR lacks a label and requires one.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants