2 Commits

Author SHA1 Message Date
freemo 17e7507a4d fix(lsp): release lock before blocking I/O in LspLifecycleManager.restart_server() to prevent deadlock
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
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
freemo 31472b5413 test(coverage): add Behave scenarios for 39 under-covered modules
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 21s
CI / helm (pull_request) Successful in 22s
CI / lint (pull_request) Successful in 3m20s
CI / quality (pull_request) Successful in 3m43s
CI / typecheck (pull_request) Successful in 3m58s
CI / security (pull_request) Successful in 4m8s
CI / integration_tests (pull_request) Successful in 9m33s
CI / unit_tests (pull_request) Successful in 10m12s
CI / docker (pull_request) Successful in 1m28s
CI / coverage (pull_request) Successful in 12m18s
CI / e2e_tests (pull_request) Successful in 19m51s
CI / status-check (pull_request) Successful in 1s
CI / build (push) Successful in 15s
CI / helm (push) Successful in 22s
CI / lint (push) Successful in 3m18s
CI / quality (push) Successful in 3m41s
CI / typecheck (push) Successful in 3m57s
CI / benchmark-regression (push) Has been skipped
CI / security (push) Successful in 4m10s
CI / unit_tests (push) Failing after 6m58s
CI / docker (push) Has been skipped
CI / integration_tests (push) Successful in 9m15s
CI / coverage (push) Successful in 12m26s
CI / e2e_tests (push) Successful in 23m11s
CI / status-check (push) Failing after 1s
CI / benchmark-publish (push) Successful in 28m31s
CI / benchmark-regression (pull_request) Successful in 54m53s
Add Behave feature/step pairs that exercise uncovered branches across handlers, LSP, CLI, and service layers to reach the coverage gate.

ISSUES CLOSED: #1232
2026-03-31 21:47:12 +00:00