You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: guard resolveThreadWriter with semaphore to prevent TOCTOU race
Multiple adapter fibers can concurrently call resolveThreadWriter for
the same thread segment (e.g. _global). The check-then-create pattern
yields between get() and set(), allowing duplicate writers to be created.
The second writer overwrites the first in the map, orphaning its file
handle and batched logger.
Wrap the resolve logic with a Semaphore(1) so only one fiber can create
a writer for a given segment at a time.
0 commit comments