mysteriumnetwork/node

Data race

Zensey opened this issue · 0 comments

Follow up to #5999

Describe the bug
A data race have been found

==================
WARNING: DATA RACE
Read at 0x00c000cd40c0 by goroutine 277:
  github.com/mysteriumnetwork/node/tequilapi/endpoints.(*ServiceEndpoint).toServiceInfoResponse()
      C:/Users/user/src/node/tequilapi/endpoints/service.go:349 +0xc7
  github.com/mysteriumnetwork/node/tequilapi/endpoints.(*ServiceEndpoint).ServiceStart()
      C:/Users/user/src/node/tequilapi/endpoints/service.go:201 +0x8b7
  github.com/mysteriumnetwork/node/tequilapi/endpoints.(*ServiceEndpoint).ServiceStart-fm()
      <autogenerated>:1 +0x3d
  github.com/gin-gonic/gin.(*Context).Next()
      C:/Users/user/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0xb8
  github.com/mysteriumnetwork/go-rest/apierror.ErrorHandler()
      C:/Users/user/go/pkg/mod/github.com/mysteriumnetwork/go-rest@v0.3.1/apierror/middleware.go:28 +0x48
  github.com/gin-gonic/gin.(*Context).Next()
      C:/Users/user/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x15a
  github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1()
      C:/Users/user/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 +0xd4
  github.com/gin-gonic/gin.(*Context).Next()
      C:/Users/user/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0xbb5
  github.com/gin-gonic/gin.(*Engine).handleHTTPRequest()
      C:/Users/user/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 +0x7b9
  github.com/gin-gonic/gin.(*Engine).ServeHTTP()
      C:/Users/user/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 +0x418
  net/http.serverHandler.ServeHTTP()
      C:/Program Files/Go/src/net/http/server.go:3137 +0x2a1
  net/http.(*conn).serve()
      C:/Program Files/Go/src/net/http/server.go:2039 +0x13c4
  net/http.(*Server).Serve.gowrap3()
      C:/Program Files/Go/src/net/http/server.go:3285 +0x4f

Previous write at 0x00c000cd40c0 by goroutine 308:
  github.com/mysteriumnetwork/node/core/service.(*Instance).proposalWithCurrentLocation()
      C:/Users/user/src/node/core/service/pool.go:196 +0x4bc
  github.com/mysteriumnetwork/node/core/service.(*Instance).proposalWithCurrentLocation-fm()
      <autogenerated>:1 +0x84
  github.com/mysteriumnetwork/node/core/discovery.(*Discovery).registerProposal()
      C:/Users/user/src/node/core/discovery/discovery.go:186 +0x58
  github.com/mysteriumnetwork/node/core/discovery.(*Discovery).mainDiscoveryLoop.gowrap2()
      C:/Users/user/src/node/core/discovery/discovery.go:132 +0x33

Goroutine 277 (running) created at:
  net/http.(*Server).Serve()
      C:/Program Files/Go/src/net/http/server.go:3285 +0x8ec
  net/http.Serve()
      C:/Program Files/Go/src/net/http/server.go:2794 +0x130
  github.com/mysteriumnetwork/node/tequilapi.(*apiServer).serve()
      C:/Users/user/src/node/tequilapi/http_api_server.go:139 +0x32
  github.com/mysteriumnetwork/node/tequilapi.(*apiServer).StartServing.gowrap1()
      C:/Users/user/src/node/tequilapi/http_api_server.go:129 +0x1f

Goroutine 308 (running) created at:
  github.com/mysteriumnetwork/node/core/discovery.(*Discovery).mainDiscoveryLoop()
      C:/Users/user/src/node/core/discovery/discovery.go:132 +0x24a
  github.com/mysteriumnetwork/node/core/discovery.(*Discovery).Start.gowrap3()
      C:/Users/user/src/node/core/discovery/discovery.go:104 +0x33
==================

Environment (please complete the following information):

  • Node version: 1.29.21