8000 8000 fix(minimald,sandbox): a task that ends during its network attach reports its own exit status, not a by minimal-foundry[bot] · Pull Request #3365 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minimald,sandbox): a task that ends during its network attach reports its own exit status, not a - #3365

Draft
minimal-foundry[bot] wants to merge 3 commits into
mainfrom
agent/3350-a-task-that-ends-during-its-network-attach-repor
Draft

minimal-foundry[bot] wants to merge 3 commits into
mainfrom
agent/3350-a-task-that-ends-during-its-network-attach-repor

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

Defect

Fixes #3350

  • Epic: none; not charged to an epic
  • Size: S; estimated 40 code, 50 tests
  • May touch:
    • crates/sandbox/src/lib.rs
    • crates/minimald/src/exec/process.rs
    • crates/minimald/src/exec/tests.rs
Task marker
### D3201 — A task that ends during its network attach reports its own exit status, not a network failure
  kind: task
  size: S
  est: 40 code, 50 tests
  executor: agent
  defect: bug
  layers:
    - sandbox:
      - crates/sandbox/src/lib.rs: makes the attach that keeps an ended process reachable from minimald, for example a pub attach_unless_ended or a variant of attach_child for the task path
      test: cargo test -p sandbox attach_unless_ended
    - minimald:
      - crates/minimald/src/exec/process.rs: attach_or_reap uses the ended-aware attach, Reapable gains an ended check, and HakoniwaProcess and NetRelease accept no guard for a task that ended
      - crates/minimald/src/exec/tests.rs: adds a test where the attach fails after the child ended, and the task gives its exit status with no error
      test: cargo test -p minimald a_task_that_ended_during_its_attach_reports_its_exit
      test: cargo test -p minimald a_refused_task_attach_stops_the_task
  proof: A min run task that exits before its network attach completes reports its own exit status, and the error connecting the task's network failed does not show.

Proof

A min task run whose process exits before its network attach completes now ends with the process's own exit status. minimald does not kill the process and does not print "connecting the task's network failed". A refused attach of a process that still runs stays an error and stops the task.

Notes from the agent: sandbox: PlannedLaunch::attach_unless_ended is now pub, and it has a new test whose name the test line matches. minimald: Reapable gains has_ended (try_wait on hakoniwa::Child). attach_or_reap calls attach_unless_ended a 8000 nd returns Option. HakoniwaProcess::new and NetRelease::new take Option. The new minimald test uses a fake child, so it proves that attach_or_reap does not reap the ended process and owes no guard. No test here runs a real container to read the exit status end to end. cargo clippy -p minimald --all-targets gave no warnings. I did not run just clippy-strict.

Tests

line exit tail
cargo test -p sandbox attach_unless_ended 0 running 1 test test tests::attach_unless_ended_is_no_failure_for_an_ended_process ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 79 filtered out; finished in 0.00s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out; finished in 0.00s
cargo test -p minimald a_task_that_ended_during_its_attach_reports_its_exit 0 running 1 test test exec::tests::a_task_that_ended_during_its_attach_reports_its_exit ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1468 filtered out; finished in 0.00s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 10 filtered out; finished in
cargo test -p minimald a_refused_task_attach_stops_the_task 0 running 1 test test exec::tests::a_refused_task_attach_stops_the_task ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1468 filtered out; finished in 0.00s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 10 filtered out; finished in 0.00s running

Verify

min task run agent-verify timed out after 1800s, so this PR is a draft.

ACHE_REGION=auto\u{1f}SCCACHE_S3_USE_SSL=true\u{1f}SHELL=/usr/bin/bash\u{1f}SHLVL=2\u{1f}SSL_CERT_DIR=/etc/ssl/certs\u{1f}SSL_CERT_FILE=/etc/ssl/cert.pem\u{1f}XDG_CACHE_HOME=/state/cache\u{1f}XDG_CONFIG_HOME=/home/.config\u{1f}XDG_DATA_HOME=/home/.local/share\u{1f}XDG_RUNTIME_DIR=/run\u{1f}XDG_STATE_HOME=/home/.local/state\u{1e}stdin\n"
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   0.625s] ( 601/1569) minimald env::tests::refresh_remaps_the_installed_set_onto_the_new_graph
        PASS [   0.234s] ( 602/1569) minimald env::tests::task_entrypoint_relays_the_task_exit_code
        SLOW [> 60.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>120.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>180.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>240.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>300.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>360.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>420.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>480.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>540.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>600.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>660.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>720.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>780.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>840.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>900.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>960.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1020.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1080.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1140.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1200.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1260.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1320.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1380.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1440.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task

Base

The base branch moved while the coder worked; it was merged in before the tests ran.

minimald holds its task process behind its own type, so it needs the
ended-aware attach without a hakoniwa::Child in hand.
A task that exited while its network was being attached took its
namespace with it, and the refused attach killed the task and showed
"connecting the task's network failed". attach_or_reap now asks
whether the process ended, keeps it unreaped, and owes no guard.
@coderabbitai
coderabbitai Bot commented Nov 13, 2026
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: efd70a5a-1ad9-422c-bfa7-f9df850adb45

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@norrietaylor
Copy link
Copy Markdown
Member

/revise make min task run agent-verify finish: it timed out after 1800s on this head (b43246fa), so this PR is a draft.

Evidence: the PR body says min task run agent-verify timed out after 1800s. This task's own test: lines ran, and GitHub CI is green on every lane.

Do:

  1. Run the verify, and find out whether a test this change adds or touches hangs or runs much longer than the others (for example, a wait on a network attach that never ends).
  2. If so, fix the cause, so that the test ends in bounded time. Do not mark it ignored, and do not narrow what it checks.
  3. If the run is slow only because the workspace builds cold, and no test of this change hangs, change no file. Give the evidence (the slowest tests and their times) in your final message.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D3201 — A task that ends during its network attach reports its own exit status, not a network failure

1 participant

0