Repository navigation
fix(BA-8114): detect an orphan agent by its rpc port when the pid-file is missing - #14958
Merged
Merged
Conversation
…e is missing The dev script identified agent/sftp-agent solely by their pid-files, so a missing agent.pid made restart skip the stop: the orphan agent kept its ports and the freshly started agent died on bind (Errno 98) with its tmux window closing traceless. Resolve the agent pid via the pid-file first and fall back to the listener of the rpc-listen-addr port from the service's toml, walking up from the worker to the main process. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
agatha197
marked this pull request as draft
September 23, 2026 02:22
agatha197
marked this pull request as ready for review
September 23, 2026 02:23
seedspirit
approved these changes
Sep 28, 2026
Contributor
|
This PR has had no activity for 14 days and has been marked as stale. It will be closed on 2026-10-27 (in 14 days) if no further activity occurs. Push a commit or leave a comment to keep it open. |
fregataa
approved these changes
Oct 22, 2026
lablup-octodog
added a commit
that referenced
this pull request
Oct 22, 2026
lablup-octodog
added a commit
that referenced
this pull request
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
./devidentified agent/sftp-agent solely by their pid-files (both share thebackend.ai: agentproctitle), so a missingagent.pidmaderestartskip the stop: the orphan agent kept its ports and the freshly started agent died on bind (OSError: [Errno 98] Address already in use), its tmux window closing traceless whilestatusreported "stopped"._get_agent_pid: resolve the pid-file first, then fall back to the listener of therpc-listen-addrport from the service's toml (ss -tlnpH), walking up from the worker listener to the main process._is_running,_stop_service, andstatusnow use it, so orphans are detected and terminated even without a pid-file.Test plan
agent.piddeleted and an orphan agent running:./dev statusreports the orphan as running with its real pid./dev restart agentkills the orphan and the new agent starts cleanly, rewritingagent.pid./dev restart allrestarts every service; all 7 report running and both agents areALIVEin the manager DBResolves #14957 (BA-8114)
🤖 Generated with Claude Code