Problem
Inside the run_source tick loop, send_to_worker(...).await?, await_reply(...).await?, and apply_params_update(...).await? can return early via ? before the final worker.shutdown().await. These exits use the InstanceWorker::Drop fallback (detach), which is safe but means the deterministic join from #519 only applies to clean exits and plugin-reported errors.
Context
This is intentional for now — joining on a timed-out or wedged FFI call would block spawn_blocking for the full timeout duration. The Arc<InstanceState> keeps the plugin alive until the worker finishes.
However, it may be worth exploring a bounded join with a secondary timeout, so the worker is given a chance to drain before detaching.
Suggested approach
On the ? error paths, take the join handle before returning and attempt a short bounded join (e.g. 100ms via spawn_blocking + tokio::time::timeout). Fall back to detach if the join times out.
Related: #481, #519
Problem
Inside the
run_sourcetick loop,send_to_worker(...).await?,await_reply(...).await?, andapply_params_update(...).await?can return early via?before the finalworker.shutdown().await. These exits use theInstanceWorker::Dropfallback (detach), which is safe but means the deterministic join from #519 only applies to clean exits and plugin-reported errors.Context
This is intentional for now — joining on a timed-out or wedged FFI call would block
spawn_blockingfor the full timeout duration. TheArc<InstanceState>keeps the plugin alive until the worker finishes.However, it may be worth exploring a bounded join with a secondary timeout, so the worker is given a chance to drain before detaching.
Suggested approach
On the
?error paths, take the join handle before returning and attempt a short bounded join (e.g. 100ms viaspawn_blocking+tokio::time::timeout). Fall back to detach if the join times out.Related: #481, #519