Closed Milly closed 2 months ago
The updates focus on refactoring how connections and worker processes are handled, enhanced error and signal management, and improved testing. Key improvements include renaming functions, using new utilities for async signal handling, managing connections and processes more efficiently, and refining test logic. These changes collectively enhance the robustness and maintainability of the system.
File | Summary |
---|---|
denops/.../cli.ts |
Refactored connection handling, introduced processWorker , improved error handling, and added signal management. |
denops/.../cli_test.ts |
Updated imports and test logic to align with new connection and signal handling mechanisms. |
denops/.../testutil/shared_server.ts |
Refactored stdout handling, added an abort function for cancellations, and improved disposal error handling. |
denops/.../worker.ts |
Added signal handling for SIGINT and modified worker process flow. |
denops/.../worker_test.ts |
Updated imports, added stubs, and adjusted tests for new signal and worker handling. |
tests/denops/server_test.ts |
Removed verbose: true setting from a test to adjust verbosity levels. |
sequenceDiagram
participant CLI as cli.ts
participant Worker as worker.ts
participant Listener as TCP Listener
participant Signal as SIGINT
CLI->>Listener: Start listening for connections
Listener-->>CLI: New connection
CLI->>Worker: processWorker(conn)
Note over Worker: Worker processes the connection<br>and manages termination
Signal-->>Worker: SIGINT triggered
Worker->>CLI: Handle SIGINT, close connection
CLI->>Listener: Continue listening
Signal-->>Worker: Wait for signal
Worker-->>Signal: Handle signal
Worker->>CLI: Ensure all connections are terminated
In fields of code where bytes do leap, A rabbit hops, refactors deep. Connections managed with great care, Signals handled in the air. Tests renewed, robustness found, In this warren, code's profound. 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 96.20253%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 92.37%. Comparing base (
e8e6d8c
) to head (38980d9
).
Files | Patch % | Lines |
---|---|---|
denops/@denops-private/testutil/shared_server.ts | 92.85% | 2 Missing :warning: |
denops/@denops-private/cli.ts | 97.72% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@coderabbitai review
When the cli process traps
SIGINT
, it will do the following:When the connection is disconnected, it will do the following:
This PR alone does not include any new features. This is because the termination processing of the worker has not been implemented. This will allow we to implement the termination processing of the worker.
Summary by CodeRabbit
Refactor
Tests
Chores