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

Race on WebSocket handlers #34

Open
Wondertan opened this issue May 31, 2019 · 0 comments
Open

Race on WebSocket handlers #34

Wondertan opened this issue May 31, 2019 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Wondertan
Copy link
Contributor

Touches every WebSocket subscriber implementation.
All implementations have map of maps. Also, there is lock which defends wrapper map, but underlying maps are not backed by any lock, what causes Race Condition.

WARNING: DATA RACE
Write at 0x00c0000a64b0 by goroutine 74:
  runtime.mapdelete_fast64()
      /usr/local/Cellar/go/1.12/libexec/src/runtime/map_fast64.go:272 +0x0
  github.com/proximax-storage/go-xpx-catapult-sdk/sdk/websocket/subscribers.(*partialAddedImpl).RemoveHandlers()
      /go/pkg/mod/github.com/proximax-storage/[email protected]/sdk/websocket/subscribers/partial_added.go:65 +0x252
  github.com/proximax-storage/go-xpx-catapult-sdk/sdk/websocket/handlers.(*partialAddedHandler).Handle.func1()
      /go/pkg/mod/github.com/proximax-storage/[email protected]/sdk/websocket/handlers/partial_added.go:46 +0x13a

Previous read at 0x00c0000a64b0 by goroutine 84:
  runtime.mapiternext()
      /usr/local/Cellar/go/1.12/libexec/src/runtime/map.go:853 +0x0
  github.com/proximax-storage/go-xpx-catapult-sdk/sdk/websocket/handlers.(*partialAddedHandler).Handle()
      /go/pkg/mod/github.com/proximax-storage/[email protected]/sdk/websocket/handlers/partial_added.go:35 +0x2cd
  github.com/proximax-storage/go-xpx-catapult-sdk/sdk/websocket.(*messageRouter).RouteMessage()
      /go/pkg/mod/github.com/proximax-storage/[email protected]/sdk/websocket/router.go:43 +0x19e

Goroutine 74 (running) created at:
  github.com/proximax-storage/go-xpx-catapult-sdk/sdk/websocket/handlers.(*partialAddedHandler).Handle()
      /go/pkg/mod/github.com/proximax-storage/[email protected]/sdk/websocket/handlers/partial_added.go:37 +0x2bc
  github.com/proximax-storage/go-xpx-catapult-sdk/sdk/websocket.(*messageRouter).RouteMessage()
      /go/pkg/mod/github.com/proximax-storage/[email protected]/sdk/websocket/router.go:43 +0x19e

Goroutine 84 (running) created at:
  github.com/proximax-storage/go-xpx-catapult-sdk/sdk/websocket.(*CatapultWebsocketClientImpl).Listen()
      /go/pkg/mod/github.com/proximax-storage/[email protected]/sdk/websocket/client.go:168 +0x182

@Wondertan Wondertan added bug Something isn't working help wanted Extra attention is needed labels May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant