Skip to content

Make Process.wait safe to retry after timeout - #98

Merged
floitsch merged 2 commits into
mainfrom
fix/cancel-safe-process-wait
Aug 29, 2026
Merged

Make Process.wait safe to retry after timeout#98
floitsch merged 2 commits into
mainfrom
fix/cancel-safe-process-wait

Conversation

@floitsch

@floitsch floitsch commented Aug 29, 2026

Copy link
Copy Markdown
Member

Summary

  • retain one subprocess ResourceState across an interrupted wait
  • reuse that state when Process.wait is retried and cache the exit result
  • safely dispose pending wait state when wait-ignore is used
  • best-effort ignore abandoned waiters through finalization while retaining the explicit wait or wait-ignore contract
  • cover repeated timeouts followed by SIGKILL, plus a child that ignores SIGTERM

The complementary SDK-side defensive fix is toitlang/toit#3197. The supported Process termination API is the stacked follow-up #99.

Tests

  • toit analyze src/pipe.toit tests/pipe2_test.toit
  • toit run tests/pipe2_test.toit
  • rebuilt SDK also passed tests/pipe2_test.toit

@floitsch
floitsch merged commit b633696 into main Aug 29, 2026
7 checks passed
@floitsch
floitsch deleted the fix/cancel-safe-process-wait branch August 29, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant