This release introduces comprehensive supervision improvements for async
operations and eliminates potential deadlocks in callback execution.
Task Supervision
- Added SnakeBridge.TaskSupervisor to the application supervision tree
- Stream workers now run under TaskSupervisor instead of unsupervised Task.start
- Session cleanup tasks are supervised for reliable resource release
- Callback invocations execute in supervised tasks with GenServer.reply/2
Callback Registry Deadlock Prevention
- Refactored invoke/2 to spawn async tasks instead of blocking handle_call
- Callbacks can now safely invoke other callbacks without deadlocking
- Registry remains responsive during long-running callback execution
- Added catch clause for non-exception throws in callback execution
ETS Table Ownership
- Added CacheOwner GenServer to own long-lived ETS tables
- Tables :snakebridge_docs and :snakebridge_exception_cache survive caller exit
- Modules gracefully handle missing tables during compile-time tooling
- Removed on-demand table creation from Docs and DynamicException modules
Stream Timeout Support
- Added :stream_timeout runtime option for stream_dynamic operations
- Configurable timeout with :infinity support for unlimited waits
- Workers are killed on timeout to prevent resource leaks
- Default timeout available via SnakeBridge.Defaults.runtime_default_stream_timeout/0
Session Cleanup Configuration
- Added :session_cleanup_timeout_ms application config option
- Cleanup tasks pass timeout to Runtime.release_session/2
- Default cleanup timeout of 10 seconds
Telemetry Robustness
- Added telemetry_ready?/0 checks before emitting events
- Prevents crashes when telemetry tables don't exist during compilation
- Applied consistently across Runtime, Streamer, Telemetry, and IntrospectionRunner
File Locking Improvements
- Replaced :global.trans with file-based .lock mechanism
- Retry logic with configurable attempts and backoff
- More reliable across distributed compilation scenarios
Dependency Updates
- Updated snakepit to v0.11.1
Code Quality
- Lock.Verifier uses Logger.warning instead of Mix.shell().info
- Extracted helper functions for cache table access patterns
Test Coverage
- Added CacheOwnerTest verifying table ownership semantics
- Added callback tests for non-blocking invocation behavior
- Added nested callback invocation test proving deadlock prevention
- Added RuntimeStreamerTimeoutTest for timeout and worker cleanup