Repository navigation
fix(cli): time out when the DMS server doesn't answer - #3791
Merged
Merged
Conversation
The CLI's server client dialed the socket with no deadline. If the server process is stopped or stuck, the kernel still accepts the connection, so every server-first command (clipboard, open, matugen queue, icc, qr, notify actions) waited forever for the greeting. The fire-and-forget path ignored the missing greeting too, so matugen queue reported success and never fell back to running matugen itself. Bound dialing, the greeting and the request write by 2 seconds, like the qsipc client does, and treat a missing greeting as an error. The wait for the reply stays unbounded, because matugen queue --wait can take up to its own 90 second timeout.
Member
|
/claude review |
Contributor
Claude reviewLooks good; one minor error-message glitch.
|
A server that accepts and closes before the greeting left scanner.Err() nil, so the error read "server did not respond: %!w(<nil>)". Fall back to io.EOF and test the closed connection.
Member
|
/claude review |
Contributor
Claude reviewNo issues found. The earlier |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a timeout to the CLI's connection to the DMS server.
sendServerRequestandsendServerRequestFireAndForgetdialed the socket with no deadline. If the server process is stopped or stuck, the socket still accepts connections, so every command that goes through the server (clipboard,dms open,matugen queue, icc, qr) hangs forever waiting for the greeting.matugen queuewithout--waitis the worst case, since the shell runs it on every theme change: before, it didn't check for the greeting at all, so it reported success and never fell back to running matugen itself.Changes:
qsipcclient uses.matugen queue --waitcan take up to its own 90 second timeout.Type of change
Related issues
None.
Screenshots / video
Checklist
I18n.tr()with translator context, reusing existing terms where possiblemake fmt, added/updated tests,make testpasses, andgo mod tidyis cleanmake lint-qmlwith no new warningsTested against a fake socket that accepts but never answers:
dms clipboard historyhangs on master and exits after 2 seconds with "server did not respond" on this branch. The new tests inserver_client_test.gocover both the silent server and a slow reply that still has to succeed.go test ./..., the FreeBSD cross-build and all pre-commit hooks pass. No QML, no new strings, no docs needed.