Improve state channel handling to prevent panics on closed channel#6181
Merged
Improve state channel handling to prevent panics on closed channel#6181
Conversation
2026/04/08 04:42:01 [Recovery] 2026/04/08 - 04:42:01 panic recovered: send on closed channel /usr/local/go/src/runtime/chan.go:226 (0x41131d) /usr/local/go/src/runtime/chan.go:161 (0x410db6) /go/src/github.com/mysteriumnetwork/node/services/wireguard/connection/connection.go:131 (0x12a3064) /go/src/github.com/mysteriumnetwork/node/services/wireguard/connection/connection.go:104 (0x12a2da4) /go/src/github.com/mysteriumnetwork/node/core/connection/manager.go:703 (0xe900aa) /go/src/github.com/mysteriumnetwork/node/core/connection/manager.go:292 (0xe8ac88) /go/src/github.com/mysteriumnetwork/node/core/connection/multi.go:58 (0xe92874) /go/src/github.com/mysteriumnetwork/node/tequilapi/endpoints/connection.go:207 (0x126b18a) /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xa2111a) /go/pkg/mod/github.com/mysteriumnetwork/go-rest@v0.3.1/apierror/middleware.go:28 (0xa21108) /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xa1712e) /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0xa1711b) /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xa15f6d) /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0xa15c04) /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0xa15749) /usr/local/go/src/net/http/server.go:3301 (0x8162cd) /usr/local/go/src/net/http/server.go:2102 (0x7f4c64) /usr/local/go/src/runtime/asm_amd64.s:1700 (0x482240)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6181 +/- ##
==========================================
- Coverage 25.58% 25.54% -0.05%
==========================================
Files 539 540 +1
Lines 31034 31091 +57
==========================================
+ Hits 7941 7942 +1
- Misses 22304 22359 +55
- Partials 789 790 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
redhatua
approved these changes
Apr 8, 2026
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.
2026/04/08 04:42:01 [Recovery] 2026/04/08 - 04:42:01 panic recovered: send on closed channel /usr/local/go/src/runtime/chan.go:226 (0x41131d) /usr/local/go/src/runtime/chan.go:161 (0x410db6) /go/src/github.com/mysteriumnetwork/node/services/wireguard/connection/connection.go:131 (0x12a3064) /go/src/github.com/mysteriumnetwork/node/services/wireguard/connection/connection.go:104 (0x12a2da4) /go/src/github.com/mysteriumnetwork/node/core/connection/manager.go:703 (0xe900aa) /go/src/github.com/mysteriumnetwork/node/core/connection/manager.go:292 (0xe8ac88) /go/src/github.com/mysteriumnetwork/node/core/connection/multi.go:58 (0xe92874) /go/src/github.com/mysteriumnetwork/node/tequilapi/endpoints/connection.go:207 (0x126b18a) /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xa2111a) /go/pkg/mod/github.com/mysteriumnetwork/go-rest@v0.3.1/apierror/middleware.go:28 (0xa21108) /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xa1712e) /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0xa1711b) /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0xa15f6d) /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0xa15c04) /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0xa15749) /usr/local/go/src/net/http/server.go:3301 (0x8162cd) /usr/local/go/src/net/http/server.go:2102 (0x7f4c64) /usr/local/go/src/runtime/asm_amd64.s:1700 (0x482240)