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

Daemon Race for client count #102

Open
mohamedmansour opened this issue Nov 12, 2021 · 0 comments
Open

Daemon Race for client count #102

mohamedmansour opened this issue Nov 12, 2021 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mohamedmansour
Copy link
Owner

This only happens on startup while running --race, just once it happens

==================
WARNING: DATA RACE
Read at 0x00c00020a450 by goroutine 98:
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).handleInitialData.func1()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:545 +0xc71
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Client).readPump()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/client.go:134 +0x57c
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).serveWebSocket·dwrap·7()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:347 +0x39

Previous write at 0x00c00020a450 by goroutine 84:
  runtime.mapassign_fast64()
      /usr/local/go/src/runtime/map_fast64.go:92 +0x0
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).listen()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:258 +0x1ea
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).ListenAndServe·dwrap·5()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:319 +0x39

Goroutine 98 (running) created at:
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).serveWebSocket()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:347 +0x405
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).serveWebSocket-fm()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:331 +0x57
  net/http.HandlerFunc.ServeHTTP()
      /usr/local/go/src/net/http/server.go:2046 +0x4d
  net/http.(*ServeMux).ServeHTTP()
      /usr/local/go/src/net/http/server.go:2424 +0xc5
  net/http.serverHandler.ServeHTTP()
      /usr/local/go/src/net/http/server.go:2878 +0x89a
  net/http.(*conn).serve()
      /usr/local/go/src/net/http/server.go:1929 +0x12e4
  net/http.(*Server).Serve·dwrap·82()
      /usr/local/go/src/net/http/server.go:3033 +0x58

Goroutine 84 (running) created at:
  github.com/mohamedmansour/ethereum-burn-stats/daemon/hub.(*Hub).ListenAndServe()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/hub/hub.go:319 +0xa4
  github.com/mohamedmansour/ethereum-burn-stats/daemon/cmd.root()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/cmd/root.go:90 +0xc9
  github.com/mohamedmansour/ethereum-burn-stats/daemon/cmd.newRootCmd.func1()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/cmd/root.go:42 +0x2c6
  github.com/spf13/cobra.(*Command).execute()
      /go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0xa7d
  github.com/spf13/cobra.(*Command).ExecuteC()
      /go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x5da
  github.com/spf13/cobra.(*Command).Execute()
      /go/pkg/mod/github.com/spf13/[email protected]/command.go:902 +0x29
  github.com/mohamedmansour/ethereum-burn-stats/daemon/cmd.Execute()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/cmd/root.go:100 +0x20
  main.main()
      /go/src/github.com/mohamedmansour/ethereum-burn-stats/daemon/main.go:8 +0x24
==================
@mohamedmansour mohamedmansour added bug Something isn't working help wanted Extra attention is needed labels Nov 12, 2021
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