[PR #266] [MERGED] fix: wait for daemon exit during server shutdown #302

Closed
opened 2026-10-29 14:21:58 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/266
Author: @zlzGithub-0801
Created: 9/9/2026
Status: ✅ Merged
Merged: 9/9/2026
Merged by: @yingdi-shan

Base: main ← Head: fix/wait-for-ublk-daemon-exit


📝 Commits (1)

  • d3020db fix: wait for daemon exit during server shutdown

📊 Changes

1 file changed (+62 additions, -0 deletions)

View changed files

📝 storage/ublk-daemon/src/client.rs (+62 -0)

📄 Description

What

Wait for the ublk daemon process to fully exit before completing server shutdown.

Why

The daemon may acknowledge shutdown before finishing cleanup. If the server restarts during this window, the old daemon can remove the new daemon's Unix socket, causing subsequent requests to fail.

Closes #158

Scope and non-goals

This change only coordinates shutdown between the server and its managed ublk daemon. It does not add daemon auto-restart or change systemd configuration.

Design and behavior changes

The daemon watchdog publishes a retained exit notification after child.wait() completes. shutdown() sends the shutdown request and then waits for that notification.

Compatibility and operations

  • Public API or generated protocol: N/A.
  • Configuration or defaults: N/A.
  • Snapshot manifest, artifact layout, or storage format: N/A.
  • Upgrade and rollback: N/A.
  • Host requirements, permissions, ports, or dependencies: N/A.

Validation

  • make fmt
  • make clippy
  • make test-unit
  • Relevant Rust integration tests
  • make -C services test (required when services/ changes)
  • Generated clients/server regenerated with the documented make target
  • Documentation updated
  • Benchmarks or performance comparison completed

Skipped checks and reasons:

No generated code, services, documentation, or performance-sensitive behavior changed.

Risks and reviewer notes

The server shutdown now waits until the daemon process has actually exited.

Checklist

  • The PR contains one coherent change and no unrelated formatting or refactoring.
  • New behavior is covered by tests, or I explained why testing is impractical.
  • Logs and examples contain no credentials, tokens, or private registry information.
  • I did not manually edit generated code without updating its source and regenerating it.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/266 **Author:** [@zlzGithub-0801](https://github.com/zlzGithub-0801) **Created:** 9/9/2026 **Status:** ✅ Merged **Merged:** 9/9/2026 **Merged by:** [@yingdi-shan](https://github.com/yingdi-shan) **Base:** `main` ← **Head:** `fix/wait-for-ublk-daemon-exit` --- ### 📝 Commits (1) - [`d3020db`](https://github.com/kvcache-ai/AgentENV/commit/d3020db5ad07a0f03167d1da8828fc6a5cfca713) fix: wait for daemon exit during server shutdown ### 📊 Changes **1 file changed** (+62 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `storage/ublk-daemon/src/client.rs` (+62 -0) </details> ### 📄 Description ## What Wait for the ublk daemon process to fully exit before completing server shutdown. ## Why The daemon may acknowledge shutdown before finishing cleanup. If the server restarts during this window, the old daemon can remove the new daemon's Unix socket, causing subsequent requests to fail. ## Related issue Closes #158 ## Scope and non-goals This change only coordinates shutdown between the server and its managed ublk daemon. It does not add daemon auto-restart or change systemd configuration. ## Design and behavior changes The daemon watchdog publishes a retained exit notification after `child.wait()` completes. `shutdown()` sends the shutdown request and then waits for that notification. ## Compatibility and operations - Public API or generated protocol: N/A. - Configuration or defaults: N/A. - Snapshot manifest, artifact layout, or storage format: N/A. - Upgrade and rollback: N/A. - Host requirements, permissions, ports, or dependencies: N/A. ## Validation - [x] `make fmt` - [x] `make clippy` - [x] `make test-unit` - [x] Relevant Rust integration tests - [ ] `make -C services test` (required when `services/` changes) - [ ] Generated clients/server regenerated with the documented `make` target - [ ] Documentation updated - [ ] Benchmarks or performance comparison completed Skipped checks and reasons: No generated code, services, documentation, or performance-sensitive behavior changed. ## Risks and reviewer notes The server shutdown now waits until the daemon process has actually exited. ## Checklist - [x] The PR contains one coherent change and no unrelated formatting or refactoring. - [x] New behavior is covered by tests, or I explained why testing is impractical. - [x] Logs and examples contain no credentials, tokens, or private registry information. - [x] I did not manually edit generated code without updating its source and regenerating it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:21:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#302
No description provided.