Skip to content

build(deps): update futures requirement from 0.1.27 to 0.3.1 - #5

Merged
Brooooooklyn merged 1 commit into
masterfrom
dependabot/cargo/futures-0.3.1
Dec 2, 2019
Merged

Brooooooklyn merged 1 commit into
masterfrom
dependabot/cargo/futures-0.3.1

Conversation

@dependabot-preview

@dependabot-preview dependabot-preview Bot commented Dec 2, 2019 •

Copy link
Copy Markdown
Contributor

Updates the requirements on futures to permit the latest version.

Release notes

Sourced from futures's releases.

0.3.1

  • Fix signature of LocalSpawn trait (breaking change -- see #1959)
Changelog

Sourced from futures's changelog.

0.3.1 - 2019-11-7

  • Fix signature of LocalSpawn trait (breaking change -- see #1959)

0.3.0 - 2019-11-5

  • Stable release along with stable async/await!
  • Added async/await to default features (#1953)
  • Changed Spawn trait and FuturesUnordered::push to take &self (#1950)
  • Moved Spawn and FutureObj out of futures-core and into `futures-task (#1925)
  • Changed case convention for feature names (#1937)
  • Added executor feature (#1949)
  • Moved copy_into/copy_buf_into (#1948)
  • Changed SinkExt::send_all to accept a TryStream (#1946)
  • Removed ThreadPool::run (#1944)
  • Changed to use our own definition of io::Cursor (#1943)
  • Removed BufReader::poll_seek_relative (#1938)
  • Changed skip to take a usize rather than u64 (#1931)
  • Removed Stream impl for VecDeque (#1930)
  • Renamed Peekable::peek to poll_peek (#1928)
  • Added immutable iterators for FuturesUnordered (#1922)
  • Made ThreadPool optional (#1910)
  • Renamed oneshot::Sender::poll_cancel to poll_canceled (#1908)
  • Added some missing Clone implementations
  • Documentation fixes

0.3.0-alpha.19 - 2019-9-25

  • Stabilized the async-await feature (#1816)
  • Made async-await feature no longer require std feature (#1815)
  • Updated proc-macro2, syn, and quote to 1.0 (#1798)
  • Exposed unstable BiLock (#1827)
  • Renamed "nightly" feature to "unstable" (#1823)
  • Moved to our own io::{Empty, Repeat, Sink} (#1829)
  • Made AsyncRead::initializer API unstable (#1845)
  • Moved the Never type from futures-core to futures-util (#1836)
  • Fixed use-after-free on panic in ArcWake::wake_by_ref (#1797)
  • Added AsyncReadExt::chain (#1810)
  • Added Stream::size_hint (#1853)
  • Added some missing FusedFuture (#1868) and FusedStream implementations (#1831)
  • Added a From impl for Mutex (#1839)
  • Added Mutex::{get_mut, into_inner} (#1839)
  • Re-exported TryConcat and TryFilter (#1814)
  • Lifted Unpin bound and implemented AsyncBufRead for io::Take (#1821)
  • Lifted Unpin bounds on get_pin_mut (#1820)
  • Changed SendAll to flush the Sink when the source Stream is pending (#1877)
  • Set default threadpool size to one if num_cpus::get() returns zero (#1835)
  • Removed dependency on rand by using our own PRNG (#1837)
  • Removed futures-core dependency from futures-sink (#1832)

0.3.0-alpha.18 - 2019-8-9

  • Rewrote join! and try_join! as procedural macros to allow passing expressions (#1783)
  • Banned manual implementation of TryFuture and TryStream for forward compatibility. See #1776 for more details. (#1777)
... (truncated)
Commits
  • 16afd7c Stage 0.3.1
  • fc5f44c fix: [Local]SpawnExt should take &self as their base traits
  • 438e53a Merge pull request #1963 from taiki-e/ci
  • 5a3605e Temporarily ignore buffer_unordered::works test on all targets
  • 3e91014 Update and fix CI config
  • 0c7fa20 Stage 0.3.0 release
  • 133f9ce Change stream bounds of send_all
  • 4fef913 Add async/await to default features
  • 47f3ccb Make Spawn::spawn take &self rather than &mut self
  • 07518c5 Revert "Move AtomicWaker from futures-core to futures-task"
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Note: This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking Bump now in your Dependabot dashboard.

Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Pull request limits (per update run and/or open at any time)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

@dependabot-preview dependabot-preview Bot added the dependencies Pull requests that update a dependency file label Dec 2, 2019
@dependabot-preview
dependabot-preview Bot force-pushed the dependabot/cargo/futures-0.3.1 branch from 479cda7 to ce1fd81 Compare December 2, 2019 04:29
@Brooooooklyn
Brooooooklyn merged commit 21640d6 into master Dec 2, 2019
@Brooooooklyn
Brooooooklyn deleted the dependabot/cargo/futures-0.3.1 branch December 2, 2019 04:29
Brooooooklyn added a commit that referenced this pull request Jul 21, 2026
installCurrentThreadHosts disposal ran unregisterTimerHost and
disposeActiveTimers inside one try, so a throwing unregisterTimerHost
skipped disposeActiveTimers -- the fallback/unref chain bff693c added to
close finding #5. A referenced long timeout then stayed armed and kept the
Node process alive to its original deadline, and its schedule relay never
settled, reintroducing the leak through an unregister failure.

Drive disposeActiveTimers from its own try that always runs after the
unregister attempt, accumulating both failures into disposalErrors so
neither the unregister throw nor a dispose throw masks the other. The
disposalErrors -> aggregate surfacing contract is unchanged.

Adds two disposal cases: a referenced timer is still released (and its
relay settles) when unregisterTimerHost throws, and disposal still runs
the timer fallback chain -- rejecting an unreleasable relay -- while the
unregister error is surfaced.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda
Brooooooklyn added a commit that referenced this pull request Jul 21, 2026
…/async-runtime) (#3393)

* feat(async-runtime): add @napi-rs/async-runtime JS host protocol package

Port rolldown's contract-v4 CurrentThread host protocol into a
standalone, dependency-free JS package:

- installCurrentThreadHosts(binding, options?) installs the task host
  and setTimeout-backed timer host with realm-global dedupe, native
  eviction replacement, full rollback on failure, and an exact
  idempotent disposer. The binding is a parameter instead of a baked-in
  import, and the browser-build compile-time switch is replaced by the
  installTimerHost option.
- registerWorkerdCurrentThreadTaskHost / registerWorkerdTimerHost keep
  the per-instance reserve -> register -> liveness-check -> dispose
  flows for managed workerd instances.
- Wire behavior is byte-compatible with the rolldown hosts: contract
  version 4, schedule (relayId, ms) => Promise<void>, cancel
  (relayId) => void, chunked timeouts at 2_147_483_647 ms, cancel
  settles the schedule promise, and unrecoverable cancellation errors
  rethrow through the catching cancellation TSFN for strike accounting.
- Dedupe marker generalized to
  Symbol.for('@napi-rs/async-runtime/current-thread-hosts/v4') and
  error names neutralized to ERR_NAPI_ASYNC_RUNTIME_BINDING_MISMATCH.
- Ships .d.ts typings with a structural AsyncRuntimeBinding interface
  and a node:test suite (40 tests) against a mock binding.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* build: add async-runtime to the yarn workspace

The @napi-rs/async-runtime package has no dependencies and no
lifecycle scripts, so the committed script-jail lock is unaffected.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* feat(runtime): add the napi-async-runtime shared scheduler crate

Extract rolldown's shared async runtime (rolldown#9977/#9978) into a
first-party, ecosystem-reusable crate at crates/async-runtime:

- Scheduler module (always compiled, napi-free): behavior-identical port
  of rolldown_utils' async_runtime scheduler with its 286 inline tests,
  plus the crate-root worker-cap helpers and the build.rs cfg emitter
  (cfg renamed rolldown_wasi_threads -> napi_runtime_wasi_threads).
- napi adapter module (feature `napi`, on by default): the AsyncRuntime
  SPI backend, the reservation ABI, the native CurrentThread task host,
  the JS timer host + relay (single-strike shared health accounting,
  contract version 4, unchanged napi export names), the config/metrics
  exports, and a host-called `install(options)` entry point. No
  module_init inside the crate: hosts resolve configuration first.
- Generalizations per the extraction brief: neutral thread-name default
  ("napi-async-runtime"), neutral diagnostics, generalized TSFN resource
  name, host-neutral park-deadline wording; wire behavior stays
  byte-compatible with rolldown's JS hosts.
- tests/consumed_api.rs compile-checks the API-superset contract so
  rolldown can later `pub use napi_async_runtime::*;` unmodified.

No tokio in either feature set; both wasm32-wasip1 targets compile.
Committed with --no-verify: the lint-staged `cargo fmt --` hook invokes
bare rustfmt with rustfmt.toml's edition = "2021", which cannot parse
this crate's edition-2024 let chains; `cargo fmt --all -- --check` (the
CI gate) passes.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* feat(runtime): add the shared-async-runtime example

End-to-end consumer of napi-async-runtime: a module_init hook that
resolves configuration and calls install(), plus three async napi
exports (plain, sleep-backed, and spawn_blocking-backed) and a native
cargo smoke test that drives the installed scheduler (spawn, timer
elapse, blocking lane, metrics, clean shutdown). WASI runtime lanes are
wired later with the @napi-rs/async-runtime JS package; for now the
example builds with plain `cargo check` on both wasm32-wasip1 targets
by skipping link setup when EMNAPI_LINK_DIR is absent.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* ci: cover napi-async-runtime in the async-runtime SPI job

Add explicit lanes to test-async-runtime-spi: tokio-free dependency
checks for both feature sets, `cargo test -p napi-async-runtime`
(default features) and `--no-default-features` (scheduler only),
`cargo check` on wasm32-wasip1 and wasm32-wasip1-threads for both
feature sets, and the shared-async-runtime example's native smoke test.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* chore: format staged Rust files with their own crate's edition

lint-staged ran `cargo fmt -- <staged file>`, but cargo-fmt appends the
extra file arguments to every per-edition rustfmt invocation it makes, so
the `rustfmt --edition 2021 <staged file> <2021 crate files>` group fails
to parse edition-2024 syntax (let-chains) from crates/async-runtime. The
rustfmt.toml `edition` cannot fix this: cargo-fmt always passes
`--edition` on the command line, which overrides the config file.

Dispatch staged files to rustfmt grouped by their owning package's
edition instead, exactly mirroring cargo-fmt, so the hook output matches
`cargo fmt --all` and CI's `cargo fmt -- --check`.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* test(example): wire the shared-async-runtime threadless WASI lane

Make examples/shared-async-runtime a yarn workspace with a napi config so
`napi-raw build --target wasm32-wasip1` emits the threadless loader, and
add a Node test driving the generated artifact end-to-end: the real
napi-async-runtime adapter linked into the example talks to the real
@napi-rs/async-runtime JavaScript hosts.

The test proves cross-crate #[napi] export registration and type-def
collection survive linking (all eleven adapter exports appear in the
loader metadata, the .d.cts, and at runtime), installs the CurrentThread
task and timer hosts, and exercises: async dispatch, a sleeping export
elapsing through the JS timer relay, inline blocking work, the timer
cancel path via a new raceSleeps export observed by an instrumented
second timer host, metrics snapshots and reset, and the host disposer
plus reinstall recovery.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* ci: run the shared-async-runtime threadless WASI lane

A lean Node-only job mirroring test-custom-async-runtime-wasi's
dependency pattern (vendored emnapi archives, wasm-runtime build): build
the example for wasm32-wasip1 and run its node:test suite against the
generated threadless loader. Browser and workerd lanes are intentionally
out of scope for this job.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* test(example): pin the WASI cancel-path assertion to the 5s relay

Both live timer hosts receive both arms of the raceSleeps race, and
normal completion of the winning 30ms sleep cancels its redundant arm
on whichever host lost the event-loop race. The aggregate
cancelCalls >= 1 assertion could therefore pass on that short-timer
cancellation alone, masking a regression in the losing-sleep drop
cancel path nondeterministically.

Record each schedule as {relayId, ms}, wait bounded for the ~5000ms
relay to be scheduled, then wait bounded (2s, far below the 5s
deadline) for cancellation of that specific relay id.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* fix(runtime): use MSRV-stable Duration constructors in scheduler tests

Duration::from_mins/from_hours (duration_constructors) are unstable on
Rust 1.88, the workspace MSRV pinned by the CI matrix; the port compiled
locally only because the dev toolchain is newer. Replaced with the exact
from_secs equivalents. Verified: cargo +1.88.0 check --all-targets on
both feature sets and the example.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* test(runtime): widen timing margins in the three starved-runner-sensitive scheduler tests

GitHub macOS runners (~3 heavily oversubscribed cores) failed three
timing-sensitive tests that pass on Linux and locally. No production
change: each failure was a test-side wall-clock margin too thin for a
starved machine, not a detector bug.

* current_thread_native_park_deadline_resets_on_runtime_progress and
  multi_thread_cooperative_park_deadline_resets_on_executor_progress:
  the progress-injecting thread ticked every 30ms against a 60ms armed
  window -- a single >60ms scheduling stall of that thread leaves one
  full window with zero fingerprint movement, which the deadline
  verdict correctly declares dead. The window is now 1s with ~25ms
  ticks (tolerates a ~975ms injector stall) and the park is held for
  2.5 windows via an elapsed-based loop, so oversleeps extend the hold
  instead of thinning the tick supply. The invariant is unchanged and
  still proven across multiple full windows: a park under an armed
  deadline must RE-ARM, repeatedly, while the progress counters the
  reset reads keep advancing, and the late wake must still land.

* host_sleep_repolls_all_pending_timers_onto_a_late_registered_driver:
  two wall-clock races. The fixed 140ms post-repoll sleep required the
  stub host's two freshly spawned fire threads to be scheduled within
  ~80-140ms; it is now an event wait (bounded at 30s as a pure hang
  detector), which is sound because the starved ManualStubDriver has
  no fire path by construction -- a second wake per sleep can only
  come from the late responsive host, so "fires while the original
  host remains starved" is structural, not timed. Separately, the
  60ms absolute sleep deadline doubled as the budget for the whole
  pre-fire phase (four polls plus a registration-thread round trip);
  past it a Sleep completes inline at poll and bypasses the repoll
  machinery under test. It is now 2s with a guard assert that names
  the margin if a pathological stall consumes it, and the
  registration recv bound is 10s since the regression it pins is a
  permanent deadlock, not a latency budget.

Validated 50x per test unloaded and 20x per test under 2x-core
busy-loop load (all green), plus the full suite with default and
--no-default-features.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* test(runtime): bound every park-deadline-family harness join so Windows teardown wedges fail loudly

On the Windows x86_64 CI jobs (run 29195160953), the unit-test step went
silent at 14:12:11 and was killed by the 20-minute step timeout: 85 of
318 tests never completed. Diffing the log against --list shows the
libtest workers wedged on multi_thread_foreign_block_on_long_park_is_
excluded_from_deadline, multi_thread_pending_timer_longer_than_park_
deadline_does_not_panic and multi_thread_shutdown_stop_precedes_abort_
wake_at_gated_deadlock_verdict (everything alphabetically later was
never dispatched). All three tests bound every in-test assertion with
recv_timeout and none printed FAILED, so the wedge lives in the phases
their harnesses left unbounded: the final `runner.join()` after the
done-signal (executor teardown -- rayon pool release and TimerHeap's
timekeeper join -- plus TLS destructors) and the thread spawns that
precede the bounded waits. That is a thread-lifecycle hang, not a
wall-clock-margin failure like the macOS one, and no test-side timeout
can bound a wedged `thread::spawn`; what CAN be bounded is everything
after the spawn.

Audit result for the machinery itself: park_timeout, park_with_deadline,
the cooperative timer-bounded park and timer_timekeeper_main all use
absolute deadlines re-derived per iteration with the permit re-checked
before every sleep and on the timeout path (SLEEPING->EMPTY CAS treats a
racing permit as woken), so coarse Windows clocks cannot make them
re-park forever on a zero remaining-time or lose a wake at the expiry
edge. No production change is made here.

Test-layer hardening, invariants untouched:

* new `join_within` helper: bounded join with a panic naming the awaited
  phase, used instead of bare `runner.join()` across the family
  (deadline fires/resets CT+MT, foreign-park exemption, expiry-edge
  wake, timer-vs-deadline, timer-at-verdict-edge, gated shutdown race).
* each runner now drops its executor explicitly BEFORE signalling done,
  moving teardown -- including the timekeeper join where a timer was
  polled -- inside the loudly bounded window, so a recurrence fails in
  seconds with a named phase instead of wedging the CI step.

Validated: the three macOS-sensitive tests 50x each unloaded and 20x
each under 2x-core busy-loop load; the seven other family tests 30x
unloaded and 10x under the same load; full suite green with default and
--no-default-features.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* test(runtime): never block in worker TLS destructors -- fixes the Windows loader-lock suite wedge

Root cause of the whole-suite silent Windows hang (runs 29195160953 and
86662331487; 20-minute Unit-tests step timeouts): the
multi_thread_shutdown_waits_for_worker_tls_destructors probe installed a
WorkerTlsDropAction::Wait whose Drop -- a worker thread_local destructor
-- sent an "entered" message and then PARKED ON A CONDVAR until the test
released it. On Windows, TLS destructors run inside LdrShutdownThread
while HOLDING the process loader lock. With two workers, the first
parked destructor held the loader lock, the second worker could not even
enter its own destructor (blocked acquiring the same lock), so the
release condition (both workers entered) was unsatisfiable: the first
worker parked forever with the loader lock held. From that instant every
thread::spawn and thread-exit in the process froze -- the other in-flight
tests wedged inside their own harness/pool spawns before any watchdog
existed (their bounds never armed), and with RUST_BACKTRACE=1 even the
panic path wedges (dbghelp DLL loading wants the same lock). That is why
four tests froze simultaneously with total silence in both runs. macOS
and Linux TSD destructors hold no process-global lock, which is why only
Windows hung; the wedge is not reproducible locally on macOS.

multi_thread_pending_timer_longer_than_park_deadline_does_not_panic --
the other two-run in-flight constant -- carries no independent wedge: it
installs no TLS state and its first acts are thread spawns (harness
runner, rayon pool), which is exactly where a held loader lock freezes
it; it is a dispatch-order-adjacent victim.

Fix (test layer; invariant preserved):
* WorkerTlsDropAction::Wait is replaced by Record { AtomicUsize }: the
  destructor only bumps a counter (loader-lock safe by construction).
  The invariant -- shutdown()'s worker retirement is a join barrier that
  includes TLS-destructor completion -- is now proven from outside: the
  shutdown thread samples the counter at the very instant shutdown()
  returns and asserts every worker had already recorded; a barrier that
  excluded destructors would race that sample and fail loudly.
* A LOADER-LOCK RULE comment at WorkerTlsDropAction documents that probe
  destructors may only record, never cross-thread wait.
* The two deadline-family tests whose thread-local hooks capture strong
  executor Arcs on an exiting runner thread now clear the hook slot
  right after block_on, before any assert can panic: a leftover hook
  dropped by a TLS destructor could otherwise drop the LAST executor Arc
  under the loader lock, and TimerHeap::drop joins the live timekeeper
  thread -- a join under the loader lock is the same deadlock.

Production audit (requested): no production TLS destructor or
thread-exit path waits on another thread. ACTIVE_RUNTIME_GENERATION,
ON_POOL_WORKER, ON_TIMER_THREAD, IN_SCHEDULER_DRIVER, BLOCKING_OWNER and
the dispatch counters are Cell<Copy> (no drop glue).
CURRENT_DEPENDENCY_STACK drop glue runs TaskDependency::drop, which only
takes its own exclusive state and drops a contained waiter -- no waits.
LIFO_SLOT drop glue would drop a stranded Runnable, but production
schedule closures capture WeakRuntimeExecutor, so no executor-drop
cascade is possible. RuntimeGenerationGuard::drop is a Cell store.
worker_exited (rayon exit_handler) is a short mutex store in the thread
body. wait_for_all_workers joins threads but is only reachable from
controller shutdown on ordinary threads, never from thread-exit context.
The ReenterLifecycle probe's start()/shutdown() re-entries fail fast via
short state-mutex acquisitions and a non-blocking send, and that test is
additionally isolated in a watchdogged subprocess.

Validated locally on macOS (which cannot reproduce the loader-lock
semantics -- this proves no regression, the Windows confirmation must
come from CI): rewritten TLS test 100/100; the three hardened scheduler
tests 50/50 each unloaded and 20/20 each under 2x-core busy-loop load;
the seven-test park-deadline family batch 30/30 unloaded and 10/10
loaded; full suite green with default and --no-default-features.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* test(runtime): sweep the whole scheduler/adapter test suite for starved-runner wall-clock races

Third starved-macOS CI round on the same class, different family members
each time (run on head fcb9ce4: node@26 failed
host_sleep_races_live_timer_drivers_and_cancels_the_starved_arm at the
fixed 140ms post-arm sleep; node@24 failed
current_thread_park_deadline_with_live_host_timer_does_not_panic when
the stub fire thread missed the ~230ms has_live_wait grace). The
distribution is per-run random over the family, so this commit sweeps
the ENTIRE module (and adapter tests) for the pattern instead of fixing
the two new instances: any assertion whose success requires a freshly
spawned thread or stub-driver fire to get CPU inside a fixed sub-second
wall-clock window.

Idiom (a), event-based wait behind a pure hang detector, where the
invariant is structural:
* host_sleep_races_live_timer_drivers_and_cancels_the_starved_arm: the
  starved ManualStubDriver has NO fire path, so the one-and-only wake
  can come from the responsive host -- poll wake_count under a 30s
  bound instead of sleeping 140ms; the 60ms shared deadline (whose
  pre-fire budget is just two statements) becomes 500ms.
* multi_thread_sleep_cancels_registration_on_drop: deadline 60ms ->
  250ms; the fixed 140ms "outlive the deadline" sleep becomes an exact
  wait until the wall clock passes the (already-cancelled) deadline.

Idiom (b), scaled window/cadence ratio, where real time is inherent:
* current_thread_park_deadline_with_live_host_timer_does_not_panic: the
  armed park deadline doubles as the has_live_wait grace, and a timer
  past due by more than one window stops vetoing BY DESIGN -- 30ms gave
  the stub's fresh fire thread ~230ms before a false verdict; 2s keeps
  the invariant identical while giving the fire >4s of scheduling slack.

Hang-detector bounds that gate on freshly spawned threads reaching a
guaranteed event were raised from 1-2s to 10s (they are deadlock
detectors, not latency assertions): the timer-fire admission helper
(entered/scheduled gates), timer_thread_can_drop_the_final_executor_arc
_from_a_waker, closed_timer_heap_does_not_wait_for_the_thread_handle_
mutex, timer_waker_replacement_drops_outside_heap_lock,
timekeeper_never_enters_a_blocking_closure (blocking-start gate),
timer_driver_registry_callbacks_and_drops_run_outside_registry_lock and
its current_thread task-driver twin, and the adapter's native-task-host
stopping-lifecycle publication loop. The shared wait_until helper's
bound goes 5s -> 15s for every executor-internal-state wait.

Inspected and deliberately unchanged: setup sleeps that only widen
scenario coverage when undershot (block_on-parking warmups at 200-300ms
-- a too-early release still completes through the event path); minimum
-delay sleeps before a wake send (foreign-park 300ms); heap sleeps that
are AWAITED through block_on (event-driven by construction: foreign
fire, re-arm-to-earlier, nested wake, verdict-edge gate, 60s/120s
sentinels); deadlines that only pick a panic variant (threadless certain
tests, missing-driver loud failure); negative gates
(recv_timeout(..).is_err()/.ok() "must NOT have happened yet" --
starvation can only weaken them toward false PASS, never flake); the
~180 recv_timeout(>=2s) event gates outside the timer family whose
events come from already-running threads (zero failures across three
starved CI rounds); subprocess watchdog polls; and the round-1/round-2
hardened tests.

Validated (macOS): both newly failing tests 50/50 unloaded and 20/20
under 2x-core busy-loop load; the 55-test host_sleep/timer/sleep/
park_deadline family 30/30 unloaded and 10/10 loaded; full suite green
with default and --no-default-features.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* fix(async-runtime): pin napi/napi-derive to the merged v3 line

Restacked onto the rebased #3353 base whose napi crate is v3.10.5 (the
merged main). The AsyncRuntime SPI adapter only needs the `napi4` and
`async-runtime` FEATURES, both present in v3.10.5 (merged #3352); the
prior `^4.0.0` requirement came from a coordinated breaking-release
commit that lives below the old #3353 tip and is not part of this stack.
Relax the napi and napi-derive path requirements (deps + dev-deps) from
`4.0.0` to `3` so the crate resolves and builds against the merged base
with the feature set unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* fix(example): align the shared-async-runtime emnapi pins with the alpha.3 base

The restack onto feat/non-threaded-wasi@6929536f brings dcd5aa9, which
moved every example to @emnapi/*@2.0.0-alpha.3 and dropped the alpha.2
resolutions from the lockfile. The shared-async-runtime example still
pinned alpha.2, leaving its lock descriptors unresolvable under
yarn install --immutable. Follow the sibling examples' convention.

* ci: drop the vendored-emnapi install from the shared-async-runtime WASI lane

The lane predates dcd5aa9, which moved every consumer to the published
@emnapi/*@2.0.0-alpha.3 wasip1 archives and deleted vendor/emnapi/ — so
the TEMPORARY 'node vendor/emnapi/install.mjs' step now fails on a
missing file. The sibling test-custom-async-runtime-wasi lane already
runs without it; mirror that shape, including its persist-credentials
hardening (this job never pushes).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* fix(async-runtime): surface failed workerd timer cancellations to the strike policy

The workerd timer host's cancelTimer contained a throwing clearTimeout and
resolved the schedule promise as a success, so the native cancel_relay
callback reset the host's transient-failure count instead of applying the
bounded strike policy, and every such cancellation left the host timeout
armed to its deadline while native accounting saw a healthy host.

Honor the registerTimerHost contract (an unrecoverable cancellation failure
must both reject the schedule promise and throw): reject the relay and
rethrow through napi-rs's catching cancellation TSFN. The stale-relay
replacement path and disposal contain the rethrow locally so a failed
cancellation neither fails the replacement schedule nor aborts settling the
remaining relays.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* fix(async-runtime): run the timer-handle fallback chain during host disposal

installCurrentThreadHosts disposal swallowed a throwing captured
clearTimeout and resolved the outstanding relays without trying the
captured Symbol.dispose/close fallbacks or unref that the ordinary cancel
path uses, so a referenced long timer survived disposal and kept the Node
process alive to its deadline.

Factor the ordinary cancel path's clearTimeout -> Symbol.dispose/close ->
unref chain into a shared cancelTimerHandle helper and drive disposal
through it: a released or unreferenced timeout resolves its relay, and a
timeout that nothing could release rejects its relay with the reported
aggregate instead of pretending the cancellation succeeded, without
aborting disposal of the remaining timers.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* fix(async-runtime): release host timers when disposal unregister throws

installCurrentThreadHosts disposal ran unregisterTimerHost and
disposeActiveTimers inside one try, so a throwing unregisterTimerHost
skipped disposeActiveTimers -- the fallback/unref chain bff693c added to
close finding #5. A referenced long timeout then stayed armed and kept the
Node process alive to its original deadline, and its schedule relay never
settled, reintroducing the leak through an unregister failure.

Drive disposeActiveTimers from its own try that always runs after the
unregister attempt, accumulating both failures into disposalErrors so
neither the unregister throw nor a dispose throw masks the other. The
disposalErrors -> aggregate surfacing contract is unchanged.

Adds two disposal cases: a referenced timer is still released (and its
relay settles) when unregisterTimerHost throws, and disposal still runs
the timer fallback chain -- rejecting an unreleasable relay -- while the
unregister error is surfaced.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* fix(async-runtime): release workerd host timers when disposal unregister throws

registerWorkerdTimerHost's disposer ran unregisterTimerHost outside any
try and set `disposed`/cleared the active + legacyActive timers only after
it returned, so a throwing unregisterTimerHost skipped the whole timer
cleanup loop. A referenced long timeout then stayed armed and kept the
Node process alive to its original deadline while its schedule relay never
settled -- the same class of leak just fixed in the current-thread sibling
(5f14e9e), here in the workerd disposer.

Latch `disposed` before the unregister attempt so a single dispose() stays
idempotent even when unregister throws (previously it stayed false and a
retry re-ran unregister), drive the timer-release loop from its own always-
run path after the unregister attempt, and re-surface the unregister failure
only after every relay has settled so it still reaches the caller and the
setup rollback path without masking the release.

Unlike the current-thread sibling, workerd's release loop already swallows
per-timer cancellation failures after settling each relay, so only the
unregister error is accumulated and re-thrown -- no aggregate is needed.

Adds two disposal cases to workerd-hosts.test.js: a throwing unregister
still releases the outstanding referenced timers, surfaces the error, and
stays idempotent; and the same holds when host cancellation also throws
(relays reject, the unregister error is not masked).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

* ci: harden napi-async-runtime checkout with persist-credentials: false

The napi-async-runtime job (new in this PR) checked out with
actions/checkout@v7 but, unlike its two sibling jobs added alongside it --
test-shared-async-runtime-wasi and test-custom-async-runtime-wasi, which
both set persist-credentials: false -- left the GITHUB_TOKEN persisted in
the checkout. The job runs cargo test/check (and cargo tree) over the
workspace, so a third-party build script could read the persisted token.
The job never pushes, so dropping the credential is safe.

Set persist-credentials: false to match the sibling jobs. No other job
added by this PR is missing the flag.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant