Files
orca/src/main/managed-server
Neil b7cd885aec perf(wsl): stop the idle profile-state writer thread on WSL hosts (#34545)
* perf(wsl): stop the idle profile-state writer thread on WSL hosts

The writer thread holds ~13-15 MB while orcad sits idle. On WSL hosts the
authority now closes it after a minute without a command and reopens it,
at the last acknowledged revision, for the next one (~22 ms). The desktop
and SSH hosts keep the always-on writer. Also covers an empty and a
misnamed keep-existing launch value.

* perf(wsl): count and log idle profile writer reopens

Writes arriving just over the idle window apart would churn the writer
thread unnoticed. Each reopen now counts, with one log line per ten
minutes so the field shows it.

* fix(wsl): retry a failed idle writer reopen instead of wedging saving

A failed reopen (spawn failure, thread exit, EMFILE) left the faulted
writer in place, so every later write was refused until orcad restarted.
A non-conflict initialize failure now rejects that one command and puts
the authority back in the stopped state; the next command retries at
once, repeated failures back off up to a minute, and a revision conflict
stays terminal. Abort no longer waits a tick when nothing is stopping.

* fix(wsl): let the final flush through a reopen backoff and report only terminal reopen failures

A final or maintenance flush now gets one reopen attempt even inside a
backoff, so shutdown never drops state for a transient spawn failure. A
retriable reopen failure is logged as a warning naming the retry delay
instead of reporting that saving has stopped; only a revision conflict
reaches onFailure.

* test(wsl): prove an unset idle stop arms no timer instead of sleeping

The no-option case waited in real time to show the writer stayed open.
With no idle timer armed nothing can close it later, so assert that
directly.
2026-10-27 17:15:43 -07:00
..