Files
synapse/rust
Erik JohnstonandClaude Fable 5 863ff326b7 Enforce the logcontext storage invariant in swap_current_context
The current-context storage is asymmetric: reads give the tokio task-local
precedence, but the switch primitive only ever writes the OS-thread slot. A
switch performed while a scoped task is being polled would therefore be
write-only — invisible to current_context() and never restored — silently
misattributing everything that follows. That invariant was previously
enforced only by comments; check it at the single write chokepoint and log
an error if it is ever violated.

Also update the module doc, which still described the earlier phase's
architecture where Python kept the accounting policy — set_current_context
is fully native as of this branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JFbRtswu7rsHrttJFauUUb
2026-07-16 15:06:07 +00:00
..