[go: up one dir, main page]

Bees: make task worker lifecycle thread-safe

What

Make Bees task workers thread-safe with deterministic lifecycle management, and add regression tests capturing domain contention/launch races.

Why

Standalone bees workers were race-prone under OCaml 5 domains, blocking tests and preventing deterministic cleanup; we need reliable shared workers to unblock thread-safety upgrades.

How

Use Saturn.Htbl for the hive registry, wrap shared worker state with an Eio.Mutex, ensure worker launch/shutdown happens on the main switch with resource-exhaustion retries, expose an idempotent Task_worker.shutdown for teardown, log lifecycle via new internal events, and add the standalone domain-race test into Alcotezt so the CI continuously exercises both heavy contention and launch-race scenarios.

Manually testing the MR

 EIO_BACKEND=posix dune exec src/lib_bees/test/main.exe -- --file test_bees_unit_eio.ml

Merge request reports

Loading