Skip to content

Add scoped signal events.#67

Open
samuel-williams-shopify wants to merge 23 commits into
mainfrom
add-signals-handler
Open

Add scoped signal events.#67
samuel-williams-shopify wants to merge 23 commits into
mainfrom
add-signals-handler

Conversation

@samuel-williams-shopify

@samuel-williams-shopify samuel-williams-shopify commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Use async-signals for scoped controller signal trap installation instead of the local Async::Container::Signals helper.
  • Queue trapped controller signals as preallocated Controller::SignalEvent objects so trap handlers only wake the controller event loop.
  • Add Async::Container::Events, a pipe-backed Thread::Queue wrapper that can wake IO.select.
  • Thread controller events through container/group waits and startup/restart readiness waits so signal events can interrupt blocking child waits deterministically.
  • Avoid exceptions on event pipe wake/drain by using IO#write_nonblock(..., exception: false) and IO#read_nonblock(..., exception: false).
  • Remove the temporary child GC.start workaround now that io-event v1.17.0 fixes inherited selector ownership after fork.

Testing

  • /Users/samuel/.local/state/tec/toolchain/base_profile/bin/bundle exec sus test/async/container/controller.rb
  • /Users/samuel/.local/state/tec/toolchain/base_profile/bin/bundle exec sus
  • /Users/samuel/.local/state/tec/toolchain/base_profile/bin/bundle exec bake test:external

Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
@samuel-williams-shopify samuel-williams-shopify changed the title Add scoped signal handling Add scoped signal events Jun 27, 2026
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
@samuel-williams-shopify samuel-williams-shopify force-pushed the add-signals-handler branch 2 times, most recently from 86fb228 to 46b6dcb Compare June 28, 2026 00:08
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
@samuel-williams-shopify samuel-williams-shopify changed the title Add scoped signal events Add scoped signal events. Jun 28, 2026
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
This reverts commit 6ad1df3.

Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
@samuel-williams-shopify samuel-williams-shopify force-pushed the add-signals-handler branch 2 times, most recently from 6202cdd to d16f67d Compare June 29, 2026 09:05
@samuel-williams-shopify samuel-williams-shopify force-pushed the add-signals-handler branch 5 times, most recently from a70fa54 to 3c973ab Compare June 29, 2026 09:24
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
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.

1 participant