Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket data race #1180

Open
keruch opened this issue Oct 29, 2024 · 2 comments · May be fixed by #1214
Open

WebSocket data race #1180

keruch opened this issue Oct 29, 2024 · 2 comments · May be fixed by #1214

Comments

@keruch
Copy link
Contributor

keruch commented Oct 29, 2024

Build & Test pipeline occasionally fails with writing to the closed channel + data race warning.

Logs: logs_30227684417.zip

@mtsitrin mtsitrin linked a pull request Nov 10, 2024 that will close this issue
12 tasks
@danwt danwt linked a pull request Jan 7, 2025 that will close this issue
12 tasks
@danwt
Copy link
Contributor

danwt commented Jan 7, 2025

2024-10-29T11:34:22.8260676Z === RUN   TestWebsocketCloseUnsubscribe
2024-10-29T11:34:22.8262379Z E[2024-10-29|11:34:22.825] read next WebSocket message                  error="read tcp 127.0.0.1:43645->127.0.0.1:42630: read: connection reset by peer"
2024-10-29T11:34:22.8268948Z I[2024-10-29|11:34:22.826] service start                                module=proxy msg="Starting multiAppConn service" impl=multiAppConn
2024-10-29T11:34:22.8271102Z I[2024-10-29|11:34:22.826] service start                                module=abci-client connection=query msg="Starting localClient service" impl=localClient
2024-10-29T11:34:22.8273298Z I[2024-10-29|11:34:22.826] service start                                module=abci-client connection=snapshot msg="Starting localClient service" impl=localClient
2024-10-29T11:34:22.8275830Z I[2024-10-29|11:34:22.826] service start                                module=abci-client connection=mempool msg="Starting localClient service" impl=localClient
2024-10-29T11:34:22.8277776Z I[2024-10-29|11:34:22.827] service start                                module=abci-client connection=consensus msg="Starting localClient service" impl=localClient
2024-10-29T11:34:22.8279946Z ==================
2024-10-29T11:34:22.8280213Z WARNING: DATA RACE
2024-10-29T11:34:22.8280517Z Read at 0x00c0374d2af0 by goroutine 925:
2024-10-29T11:34:22.8280881Z   runtime.chansend()
2024-10-29T11:34:22.8281752Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/runtime/chan.go:160 +0x0
2024-10-29T11:34:22.8282574Z   github.com/dymensionxyz/dymint/rpc/json.(*service).Subscribe.func1()
2024-10-29T11:34:22.8283287Z       /home/runner/work/dymint/dymint/rpc/json/service.go:157 +0x5a4
2024-10-29T11:34:22.8283945Z   github.com/dymensionxyz/dymint/rpc/json.(*service).Subscribe.gowrap1()
2024-10-29T11:34:22.8284650Z       /home/runner/work/dymint/dymint/rpc/json/service.go:160 +0x61
2024-10-29T11:34:22.8285000Z 
2024-10-29T11:34:22.8285173Z Previous write at 0x00c0374d2af0 by goroutine 921:
2024-10-29T11:34:22.8285580Z   runtime.closechan()
2024-10-29T11:34:22.8286380Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/runtime/chan.go:357 +0x0
2024-10-29T11:34:22.8287194Z   github.com/dymensionxyz/dymint/rpc/json.(*handler).wsHandler.func2()
2024-10-29T11:34:22.8287847Z       /home/runner/work/dymint/dymint/rpc/json/ws.go:65 +0x64
2024-10-29T11:34:22.8288277Z   runtime.deferreturn()
2024-10-29T11:34:22.8289111Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/runtime/panic.go:602 +0x5d
2024-10-29T11:34:22.8289972Z   github.com/dymensionxyz/dymint/rpc/json.(*handler).wsHandler-fm()
2024-10-29T11:34:22.8290471Z       <autogenerated>:1 +0x51
2024-10-29T11:34:22.8290800Z   net/http.HandlerFunc.ServeHTTP()
2024-10-29T11:34:22.8291685Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:2166 +0x47
2024-10-29T11:34:22.8292359Z   net/http.(*ServeMux).ServeHTTP()
2024-10-29T11:34:22.8293226Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:2683 +0x1ef
2024-10-29T11:34:22.8294264Z   github.com/dymensionxyz/dymint/rpc/json.(*handler).ServeHTTP()
2024-10-29T11:34:22.8294917Z       /home/runner/work/dymint/dymint/rpc/json/handler.go:49 +0xb6
2024-10-29T11:34:22.8295407Z   net/http.serverHandler.ServeHTTP()
2024-10-29T11:34:22.8296310Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:3137 +0x2a1
2024-10-29T11:34:22.8296968Z   net/http.(*conn).serve()
2024-10-29T11:34:22.8297814Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:2039 +0x13c4
2024-10-29T11:34:22.8298502Z   net/http.(*Server).Serve.gowrap3()
2024-10-29T11:34:22.8299371Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:3285 +0x4f
2024-10-29T11:34:22.8299915Z 
2024-10-29T11:34:22.8300039Z Goroutine 925 (running) created at:
2024-10-29T11:34:22.8300527Z   github.com/dymensionxyz/dymint/rpc/json.(*service).Subscribe()
2024-10-29T11:34:22.8301278Z       /home/runner/work/dymint/dymint/rpc/json/service.go:138 +0x7e5
2024-10-29T11:34:22.8301952Z   github.com/dymensionxyz/dymint/rpc/json.(*service).Subscribe-fm()
2024-10-29T11:34:22.8302453Z       <autogenerated>:1 +0x89
2024-10-29T11:34:22.8302748Z   runtime.call64()
2024-10-29T11:34:22.8303539Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/runtime/asm_amd64.s:772 +0x42
2024-10-29T11:34:22.8304202Z   reflect.Value.Call()
2024-10-29T11:34:22.8305007Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/reflect/value.go:380 +0xb5
2024-10-29T11:34:22.8305926Z   github.com/dymensionxyz/dymint/rpc/json.(*handler).serveJSONRPCforWS()
2024-10-29T11:34:22.8306626Z       /home/runner/work/dymint/dymint/rpc/json/handler.go:99 +0x7ab
2024-10-29T11:34:22.8307222Z   github.com/dymensionxyz/dymint/rpc/json.(*handler).wsHandler()
2024-10-29T11:34:22.8307850Z       /home/runner/work/dymint/dymint/rpc/json/ws.go:105 +0x92e
2024-10-29T11:34:22.8308483Z   github.com/dymensionxyz/dymint/rpc/json.(*handler).wsHandler-fm()
2024-10-29T11:34:22.8308983Z       <autogenerated>:1 +0x51
2024-10-29T11:34:22.8309492Z   net/http.HandlerFunc.ServeHTTP()
2024-10-29T11:34:22.8312024Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:2166 +0x47
2024-10-29T11:34:22.8312724Z   net/http.(*ServeMux).ServeHTTP()
2024-10-29T11:34:22.8313610Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:2683 +0x1ef
2024-10-29T11:34:22.8314427Z   github.com/dymensionxyz/dymint/rpc/json.(*handler).ServeHTTP()
2024-10-29T11:34:22.8315086Z       /home/runner/work/dymint/dymint/rpc/json/handler.go:49 +0xb6
2024-10-29T11:34:22.8315579Z   net/http.serverHandler.ServeHTTP()
2024-10-29T11:34:22.8316478Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:3137 +0x2a1
2024-10-29T11:34:22.8317147Z   net/http.(*conn).serve()
2024-10-29T11:34:22.8317992Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:2039 +0x13c4
2024-10-29T11:34:22.8318679Z   net/http.(*Server).Serve.gowrap3()
2024-10-29T11:34:22.8319787Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:3285 +0x4f
2024-10-29T11:34:22.8320340Z 
2024-10-29T11:34:22.8320471Z Goroutine 921 (finished) created at:
2024-10-29T11:34:22.8320821Z   net/http.(*Server).Serve()
2024-10-29T11:34:22.8321661Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:3285 +0x8ec
2024-10-29T11:34:22.8322378Z   net/http/httptest.(*Server).goServe.func1()
2024-10-29T11:34:22.8323333Z       /home/runner/go/pkg/mod/golang.org/[email protected]/src/net/http/httptest/server.go:310 +0xbb
2024-10-29T11:34:22.8324016Z ==================
2024-10-29T11:34:22.8324294Z panic: send on closed channel
2024-10-29T11:34:22.8324500Z 
2024-10-29T11:34:22.8324608Z goroutine 948 [running]:
2024-10-29T11:34:22.8325423Z github.com/dymensionxyz/dymint/rpc/json.(*service).Subscribe.func1({0xc0427881f8, 0x1, 0x7ff74ea57000?})
2024-10-29T11:34:22.8326199Z 	/home/runner/work/dymint/dymint/rpc/json/service.go:157 +0x5a5
2024-10-29T11:34:22.8326898Z created by github.com/dymensionxyz/dymint/rpc/json.(*service).Subscribe in goroutine 923
2024-10-29T11:34:22.8327603Z 	/home/runner/work/dymint/dymint/rpc/json/service.go:138 +0x7e6
2024-10-29T11:34:22.8437058Z FAIL	github.com/dymensionxyz/dymint/rpc/json	5.293s
2024-10-29T11:34:22.8589071Z FAIL

@danwt
Copy link
Contributor

danwt commented Jan 7, 2025

#1214

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 a pull request may close this issue.

2 participants