Skip to content

Improve state channel handling to prevent panics on closed channel#6181

Merged
soffokl merged 2 commits intomasterfrom
fix-panic-connection
Apr 8, 2026
Merged

Improve state channel handling to prevent panics on closed channel#6181
soffokl merged 2 commits intomasterfrom
fix-panic-connection

Conversation

@soffokl
Copy link
Copy Markdown
Member

@soffokl soffokl commented Apr 8, 2026

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)

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)
@soffokl soffokl self-assigned this Apr 8, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.54%. Comparing base (9ed4766) to head (7cffdc0).
⚠️ Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
services/wireguard/connection/connection.go 80.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@soffokl soffokl merged commit a0f7d69 into master Apr 8, 2026
19 checks passed
@soffokl soffokl deleted the fix-panic-connection branch April 8, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants