e49705d6af
Follow-up to PR #64171. Two writer-death hardening gaps: - queue_token_counts only spawned the writer when the thread object was None, so a writer that died from an unexpected exception could never be replaced: deltas piled up on the uncapped deque until a reader's flush drained them synchronously. Respawn on 'not thread.is_alive()' instead. (atexit re-registration on respawn is safe: unregister removes all equal bound-method registrations and the drain hook is idempotent.) - _coalesce_token_deltas ran outside the per-delta try/except in _apply_token_batch, so a merge bug (e.g. an unclassified future kwarg summing None + 0) would escape and kill the writer thread. Wrap it and fall back to applying the raw batch — coalescing is an optimization, never load-bearing. Tests: coalesce-failure fallback + dead-writer respawn.