Repository navigation
fix(jobs): stamp death notices at the reader line, print fg deaths at the wait (Refs #2769) - #3480
Merged
Merged
Conversation
…hs at the wait (Refs #2769) GNU's notify_of_job_status stamps a background death with the global line_number at the moment the notice prints (jobs.c:4641) — by then the reader has advanced to the next line (parse.y:2533) — while a foreground death is notified synchronously inside wait_for (jobs.c:3385) and stamped with the dying command's own line. rubash queued both faces for the reader boundary and stamped the just-finished command's line, losing the EOF notice outright when the sweep's completion was stashed at stream end. - refresh_background_jobs_impl: the observation gate is now the single narrow predicate (force_observe / foreground_blocked / monitor+tty); a bare reader advance no longer applies completions. - Stashed completions carry their first-seen instant; they apply once the 5 ms SIGCHLD-delivery aging has elapsed (same constant as the state-mark rule). - execute_jobs applies only coproc completions; `jobs` records no new background death. - New print_fg_signal_notice_now: fg deaths print synchronously at the wait through the shared emit core, stamped with the ambient line. Regression pin: tests/issue2769_death_notice_line_stamp_regressions.rs (pre-existing on master, 5 cells; 3 fail on base, 5 pass on head). Refs #2769
Member
Author
|
【WIN-AGENT-AUDIT】 PR #3480 第1轮 — 建议:PENDING(缺腿) 机制核查:
腿(逐项):
F 点:无。 续作记录:未动代码。 未跑/VOID 的腿:
|
Member
Author
|
【WIN-AGENT-REWORK】 PR #3480 第2轮 — 建议:PASS(缺腿补齐) 本轮补腿(WSL Linux /root/rubash-wsl,CARGO_INCREMENTAL=0,cargo test --locked -j 2):
未动代码;其余腿按第1轮审计记录全绿。判词翻 PASS,按协议 squash 合并。 |
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.
摘要
jobs边界死亡通知的行戳问题(#2769):GNU 以打印时刻的全局line_number盖戳(jobs.c:4641)——后台死亡在读者边界打印时已读到下一行(parse.y:2533),前台死亡在wait_for内同步通知(jobs.c:3385),戳为垂死命令本行。rubash 把两面都排队到读者边界、盖刚结束命令的行戳,且流末 sweep 发现的 completion 被 stash 后再无机会应用,EOF 通知直接丢失。修法(三文件,同一机制:eager recording):
refresh_background_jobs_impl的观察门收窄为单一谓词(force_observe / foreground_blocked / monitor+tty),裸 reader 前进不再应用 completion;stash 的 completion 带首次发现 instant,5 ms SIGCHLD 投递老化后应用;jobs只应用 coproc completion;新增print_fg_signal_notice_now,前台死亡在 wait 处同步打印、盖 ambient 行。回归钉:
tests/issue2769_death_notice_line_stamp_regressions.rs(master 已有,5 格;基底 3 红、头 5 绿)。Refs #2769
本 PR 删除了什么
无文件/符号删除。3 文件 +170/−56:观察谓词收窄、stashed completion 由三元组改为带 instant 的四元组、5 处
note_child_signal_death调用点改为print_fg_signal_notice_now(函数本身仍有其他调用点,未删除)。未删除任何公开 API。验证状态
cargo fmt --check通过;钉 head 5/5、base 3 红 2 绿(fail-first 逐名);10x e1/e5 矩阵;GNU oracle 三方对照。