On WSL2, a caller that cannot run ps reads a running agmsgd as stopped
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- bash
- Ambito
- cli
Direzione di ricerca
Inizia con agmsg_daemon_read_state in scripts/lib/daemon-state.sh, poi leggi i due casi non riusciti in tests/test_agmsgd_switch.bats. Segui come un risultato vuoto di ps imposta lo stato di salute e come _agmsg_pid_signal_presence distingue un pid che non esiste più. Il lavoro è terminato quando un pid attivo o non verificabile restituisce unchecked, un pid chiaramente scomparso resta stopped ed entrambi i test menzionati passano.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
On WSL2, agmsg_daemon_read_state (scripts/lib/daemon-state.sh) reads a running agmsgd as stopped when the caller cannot run ps. On other Linux hosts the same caller gets unchecked. Two existing tests in tests/test_agmsgd_switch.bats fail on WSL2 for this reason, on main (5a42555b) as well:
- "executor evidence recognizes a live ready owner and rejects a changed boot" (the
[ "$output" = unchecked ]afterpsandgetconfare replaced byexit 1) - "warn_if_stopped never records a down_notice for 'unchecked' (cannot tell is not down)"
With /proc/sys/kernel/osrelease replaced by a non-WSL string (6.18.40.1-generic) in a copy of the scripts, both pass on the same machine.
- agmsg:
mainat 5a42555b - OS: Ubuntu on WSL2, kernel
6.18.40.1-microsoft-standard-WSL2 - bats 1.13.0 (npm), Node v24.21.0
Why
On WSL the kernel release contains microsoft, so the Linux branch sets start_unreliable=1: WSL2's host time sync steps the clock, so the process start time cannot show that a pid was reused. The check that turns missing evidence into "cannot tell" is skipped for that case:
if [ -z "$current_boot" ] || { [ -z "$started_epoch" ] && [ -z "$start_unreliable" ]; }; then
case "$(_agmsg_pid_signal_presence "$pid")" in
gone) ;;
*) AGMSGD_HEALTH=unchecked ... return 0 ;;
esac
fi
The function therefore goes on to the last check, ps -p "$pid" -o stat=. When ps cannot be run (denied in a sandbox, or missing), the empty output is taken as executor exited or suspended, and AGMSGD_HEALTH stays stopped. agmsg_daemon_warn_if_stopped then reports it and, in the ordinary path, self-heals by running daemon start. That bumps op_gen and makes the running daemon step aside. #1959 describes the same sequence for a pid namespace sandbox.
Suggested fix
Treat an empty ps answer as "cannot tell" unless the pid is clearly gone. For example, when process_state is empty, ask _agmsg_pid_signal_presence: gone keeps stopped, anything else is unchecked. A Z or T state still means exited or suspended. This keeps the comment's rule ("unless the pid is clearly gone, say the check is unavailable, not stopped") on the WSL path too.
The fix proposed for #1959 does not change this path: it handles a caller in another pid namespace, where even kill -0 says "No such process". It also does not fix these two tests.
This issue was written with AI assistance (Claude Code, Claude Opus 5.5). I reviewed it, and the observations above come from my own machine.
- Lingua principale
- Shell
- Stelle
- 1.5k
- Fork
- 156
- Merge medio
- 15h 56m
- PR unite (30g)
- 231
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fujibee/agmsg
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
[P2] app: peer-message previews pass C0/DEL control bytes to pty_injectForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di fujibee/agmsg
Issue simili
-
S3: friction & debt verified ws:tooling
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
MedakaLang/medaka#5275 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 70/100
CachyOS/copr-linux-cachyos#124 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
community-scripts/ProxmoxVE#18624 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
melodic-software/claude-code-plugins#15539 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
In-box secret files written before their chmod: lc-creds, stacks tee, and the workspace tokenApertamodel:sonnet runtime:claude security size:S
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
FootprintAI/Containarium#3671 ·
I maintainer di solito rispondono entro 1 giorno