rouse-context/scripts
monkopedia-coder 94a9b8b410
Stop abandoned bridge sessions from pinning IO threads (#778) (#781)
* Add failing gate: abandoned bridge sessions hold IO threads (#778)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YYSPuh9bZEJkrzvnEpY1QK

* Stop abandoned bridge sessions from pinning IO threads (#778)

Each bridged session read the loopback socket with a blocking
Socket.InputStream.read on Dispatchers.IO, so every live session held one
IO worker. A client that went silent mid-request (no more bytes, no CLOSE)
was never timed out by Ktor, so its worker was held forever; 64 of them
fill the shared IO pool and every withContext(Dispatchers.IO) in the app
queues behind them.

The loopback socket is now a Ktor selector-backed socket, so a waiting
session parks a coroutine instead of a thread. Sessions are also bounded
by inactivity (5 min with no bytes in either direction), which ends the
abandoned ones that nothing else would.

The removed socket-close catch was a #674 backlog entry; its row goes too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YYSPuh9bZEJkrzvnEpY1QK

---------

Co-authored-by: monkopedia-coder <monkopedia-coder@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:06:18 -04:00
..
lib Gate: a broad catch must be preceded by a cancellation clause (#674) (#720) 2026-09-03 06:59:24 -04:00
tests Give the two untested CI gates a self-test, and mechanise the rule (#705) (#759) 2026-09-15 00:20:07 -04:00
backfill-relay-secrets.sh Make a partial secret backfill fail loudly instead of exiting 0 (#686) (#693) 2026-09-02 23:23:12 -04:00
cancellation-catch-allowlist.tsv Gate: a broad catch must be preceded by a cancellation clause (#674) (#720) 2026-09-03 06:59:24 -04:00
cancellation-catch-backlog.tsv Stop abandoned bridge sessions from pinning IO threads (#778) (#781) 2026-10-19 10:06:18 -04:00
check-apk-distribution.sh Triage the masked-return findings and enable the two checks (#657) (#682) 2026-09-02 13:59:17 -04:00
check-cancellation-catch-order.sh Gate: a broad catch must be preceded by a cancellation clause (#674) (#720) 2026-09-03 06:59:24 -04:00
check-gate-selftests.sh Give the two untested CI gates a self-test, and mechanise the rule (#705) (#759) 2026-09-15 00:20:07 -04:00
check-no-manual-json.sh Share one anchoring helper across the grep gates (#597) (#697) 2026-09-03 00:31:25 -04:00
check-no-production-runblocking.sh Share one anchoring helper across the grep gates (#597) (#697) 2026-09-03 00:31:25 -04:00
check-no-sensitive-logging.sh Convert the sensitive-logging gate to the shared gate-filters helper (#696) (#704) 2026-09-03 01:27:54 -04:00
check-roborazzi-coverage.sh ci: verify the Roborazzi goldens, and prove the check can go red (#628) (#629) 2026-08-28 08:01:25 -04:00
check-roborazzi-step-order.sh Make the step-order gate report an unreadable jobs: block (#678) (#694) 2026-09-03 00:03:17 -04:00
check-shell-lint.sh Triage the masked-return findings and enable the two checks (#657) (#682) 2026-09-02 13:59:17 -04:00
check-zombie-screens.sh Triage the masked-return findings and enable the two checks (#657) (#682) 2026-09-02 13:59:17 -04:00
production-source-dirs.sh Triage the masked-return findings and enable the two checks (#657) (#682) 2026-09-02 13:59:17 -04:00