Fix shutdown hang: add timeout to discovery entry deletion#362
Merged
0pcom merged 2 commits intoskycoin:developfrom Apr 1, 2026
Merged
Fix shutdown hang: add timeout to discovery entry deletion#3620pcom merged 2 commits intoskycoin:developfrom
0pcom merged 2 commits intoskycoin:developfrom
Conversation
Client.Close() called delEntry(context.Background()) which makes HTTP requests to the discovery server with no timeout. When discovery is accessed over dmsg (the transport being closed), the Entry() lookup falls back to HTTP-over-dmsg which hangs forever since the dmsg client is already shut down. Add a 5-second timeout context so Close() always completes.
Add a hidden persistent flag --with-kill that enables the force-exit goroutine (3x Ctrl+C = os.Exit). Available on all subcommands as a safety net when graceful shutdown hangs. Usage: skywire dmsg web --with-kill
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.
Summary
Client.Close()calleddelEntry(context.Background())with no timeoutEntry()lookup falls back to HTTP-over-dmsg and hangs foreverClose()always completesTest plan
go build ./...go test ./pkg/dmsg/...passesgolangci-lint runcleanskywire dmsg web, Ctrl+C, verify process exits within ~5 seconds🤖 Generated with Claude Code