Files
cleveragents-core/features
freemo 17e7507a4d
CI / lint (pull_request) Successful in 20s
CI / typecheck (pull_request) Successful in 47s
CI / quality (pull_request) Successful in 37s
CI / security (pull_request) Successful in 1m0s
CI / build (pull_request) Successful in 27s
CI / helm (pull_request) Successful in 24s
CI / unit_tests (pull_request) Successful in 6m50s
CI / e2e_tests (pull_request) Successful in 16m59s
CI / coverage (pull_request) Successful in 10m54s
CI / docker (pull_request) Successful in 1m39s
CI / integration_tests (pull_request) Successful in 23m0s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 56m47s
fix(lsp): release lock before blocking I/O in LspLifecycleManager.restart_server() to prevent deadlock
Refactored restart_server() to use the same 3-phase lock pattern already
employed by start_server(), eliminating a deadlock hazard that occurred when
the method held _lock across blocking I/O operations (transport.stop(),
transport.start(), and client.initialize()).

Phase 1 (short lock): reads current state, snapshots required fields, and
removes the old server entry so concurrent callers see the server as absent
during the restart window.

Phase 2 (no lock): stops the old transport, spawns the new process, and
performs the LSP handshake — all without holding _lock. These operations
can block for up to 60 seconds; holding the lock here would starve any
concurrent health_check(), list_running(), or stop_server() calls.

Phase 3 (short lock): commits the new _ManagedServer into shared state,
preserving the original ref_count.

Three new BDD scenarios added to features/lsp_lifecycle_coverage.feature:
- health_check is not blocked while restart_server is in progress
  (uses a threading.Barrier to synchronise the two threads at the exact
  moment the lock is released)
- restart_server does not hold the lock during client.initialize
  (inspects lock state from within the mock initialize() side-effect)
- restart_server preserves the ref_count of the managed server

ISSUES CLOSED: #3026
2026-04-05 07:06:53 +00:00
..
2026-02-23 03:11:12 +00:00