Skip to content

Clean up run loop shutdown callbacks#45

Merged
satoshi-szk merged 4 commits into
novonotes:novonotes-internalfrom
satoshi-assistant:codex/run-loop-shutdown-cleanup
Jun 22, 2026
Merged

Clean up run loop shutdown callbacks#45
satoshi-szk merged 4 commits into
novonotes:novonotes-internalfrom
satoshi-assistant:codex/run-loop-shutdown-cleanup

Conversation

@satoshi-assistant

Copy link
Copy Markdown
Contributor

Summary

  • unregister platform run loop timers, sources, and queued callbacks during shutdown
  • avoid retaining RunLoopInner from scheduled callback handles by using weak references
  • add shutdown coverage for detached scheduled callbacks

Verification

  • cargo test -p novonotes_run_loop -p run_loop_timer
  • cargo clippy -p novonotes_run_loop -p run_loop_timer --all-targets -- -D warnings
  • cargo test --workspace
  • novonotes-products with local Cargo patch: cargo check -p pulsus_engine --all-targets
  • novonotes-products with local Cargo patch: cargo test -p wrac_log

Note: cargo clippy --workspace --all-targets -- -D warnings still fails on existing wry deprecated/unused-unsafe warnings unrelated to this change.

RunLoopGuard may be the last owner before a plugin DSO is unloaded, so shutdown must unregister native callbacks and drop queued work before returning.
Keep Linux sender cleanup source-based instead of retaining a callback queue, and make inactive handles explicit after shutdown.
Explain why platform shutdown must synchronously unregister native callbacks before plugin DSO unload.
Synchronize platform sender enqueue paths with shutdown so no native callback or queued closure can survive the final RunLoopGuard drop.
@satoshi-szk
satoshi-szk merged commit 93d7ed4 into novonotes:novonotes-internal Jun 22, 2026
4 checks passed
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.

2 participants