[PR #2500] [MERGED] remote.sh: stop the command on the host with its caller, and what it leaves running #4371

Closed
opened 2026-11-03 04:16:40 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2500
Author: @ludovic111
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: tools/remote-cleanup


📝 Commits (1)

  • 8f02822 remote.sh: stop the command on the host with its caller, and what it leaves running

📊 Changes

2 files changed (+17 additions, -3 deletions)

View changed files

📝 docs/parity-workflow.md (+1 -1)
📝 tools/remote.sh (+16 -2)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

A follow-up to #2489. When tools/remote.sh was stopped or lost its connection, the command kept running on playhorizon and held the name's lock. A game or daemon the command left behind also outlived the run: I found a leftover scope from an earlier harness run.

The command now runs in a scope named after the run (remote-<name>.scope). The scope is stopped, with everything in it:

  • when the command ends;
  • when the ssh session ends first (a watcher on the host polls the session process);
  • before the next run under that name.

Locally, stopping remote.sh (INT, TERM or HUP) ends the ssh session.

Tested against playhorizon:

Case Result
normal run (echo hi) output back, rc 0
command leaves setsid sleep 301 running gone after the run
kill -TERM to remote.sh during sleep 302 local rc 143, the host's sleep stopped within 5 s
kill -9 to the ssh client during sleep 303 local rc 137, the host's sleep stopped within 5 s
next run under the same name gets the lock, rc 0

skip-release: a dev tool.

🤖 Generated with Claude Code


🔄 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/horizon-rust/horizon/pull/2500 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `tools/remote-cleanup` --- ### 📝 Commits (1) - [`8f02822`](https://github.com/horizon-rust/horizon/commit/8f02822a9aa71d5e008d5f18b68345db7a61abc5) remote.sh: stop the command on the host with its caller, and what it leaves running ### 📊 Changes **2 files changed** (+17 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/parity-workflow.md` (+1 -1) 📝 `tools/remote.sh` (+16 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. A follow-up to #2489. When `tools/remote.sh` was stopped or lost its connection, the command kept running on playhorizon and held the name's lock. A game or daemon the command left behind also outlived the run: I found a leftover scope from an earlier harness run. The command now runs in a scope named after the run (`remote-<name>.scope`). The scope is stopped, with everything in it: - when the command ends; - when the ssh session ends first (a watcher on the host polls the session process); - before the next run under that name. Locally, stopping `remote.sh` (INT, TERM or HUP) ends the ssh session. Tested against playhorizon: | Case | Result | |---|---| | normal run (`echo hi`) | output back, rc 0 | | command leaves `setsid sleep 301` running | gone after the run | | `kill -TERM` to `remote.sh` during `sleep 302` | local rc 143, the host's `sleep` stopped within 5 s | | `kill -9` to the ssh client during `sleep 303` | local rc 137, the host's `sleep` stopped within 5 s | | next run under the same name | gets the lock, rc 0 | skip-release: a dev tool. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:16:40 +07: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
horizon-rust/horizon#4371
No description provided.