Closed HenrikSolver closed 3 years ago
While running a build from hash 6820b3e024474e2c44f7a0632261d2dc86257d77 with race detector enabled this was detected.
================== WARNING: DATA RACE Write at 0x00c0019c4e10 by goroutine 173: runtime.mapassign_faststr() runtime/map_faststr.go:202 +0x0 github.com/matrix-org/dendrite/syncapi/internal.DeviceListCatchup() github.com/matrix-org/dendrite@/syncapi/types/types.go:118 +0xd78 github.com/matrix-org/dendrite/syncapi/sync.(*RequestPool).appendDeviceLists() github.com/matrix-org/dendrite@/syncapi/sync/requestpool.go:264 +0x1d1 github.com/matrix-org/dendrite/syncapi/sync.(*RequestPool).currentSyncForUser() github.com/matrix-org/dendrite@/syncapi/sync/requestpool.go:225 +0xacf github.com/matrix-org/dendrite/syncapi/sync.(*RequestPool).OnIncomingSyncRequest() github.com/matrix-org/dendrite@/syncapi/sync/requestpool.go:130 +0x1206 github.com/matrix-org/dendrite/syncapi/routing.Setup.func1() github.com/matrix-org/dendrite@/syncapi/routing/routing.go:46 +0x59 github.com/matrix-org/dendrite/internal/httputil.MakeAuthAPI.func1() github.com/matrix-org/dendrite@/internal/httputil/httpapi.go:63 +0x43f github.com/matrix-org/util.(*jsonRequestHandlerWrapper).OnIncomingRequest() github.com/matrix-org/util@v0.0.0-20200807132607-55161520e1d4/json.go:79 +0x54 github.com/matrix-org/util.MakeJSONAPI.func1() github.com/matrix-org/util@v0.0.0-20200807132607-55161520e1d4/json.go:141 +0xd4 github.com/matrix-org/util.Protect.func1() github.com/matrix-org/util@v0.0.0-20200807132607-55161520e1d4/json.go:103 +0xbe github.com/matrix-org/dendrite/internal/httputil.MakeExternalAPI.func1() net/http/server.go:2007 +0x365 net/http.HandlerFunc.ServeHTTP() net/http/server.go:2007 +0x51 github.com/gorilla/mux.(*Router).ServeHTTP() github.com/gorilla/mux@v1.7.3/mux.go:212 +0x13e github.com/gorilla/mux.(*Router).ServeHTTP() github.com/gorilla/mux@v1.7.3/mux.go:212 +0x13e net/http.serverHandler.ServeHTTP() net/http/server.go:2802 +0xce net/http.(*conn).serve() net/http/server.go:1890 +0x837 Previous read at 0x00c0019c4e10 by goroutine 572: runtime.mapiterinit() runtime/map.go:802 +0x0 github.com/matrix-org/dendrite/syncapi/types.(*StreamingToken).IsAfter() github.com/matrix-org/dendrite@/syncapi/types/types.go:153 +0x1a3 github.com/matrix-org/dendrite/syncapi/sync.(*UserDeviceStreamListener).GetNotifyChannel() github.com/matrix-org/dendrite@/syncapi/sync/userstream.go:139 +0x14b github.com/matrix-org/dendrite/syncapi/sync.(*RequestPool).OnIncomingSyncRequest() github.com/matrix-org/dendrite@/syncapi/sync/requestpool.go:110 +0xf8e github.com/matrix-org/dendrite/syncapi/routing.Setup.func1() github.com/matrix-org/dendrite@/syncapi/routing/routing.go:46 +0x59 github.com/matrix-org/dendrite/internal/httputil.MakeAuthAPI.func1() github.com/matrix-org/dendrite@/internal/httputil/httpapi.go:63 +0x43f github.com/matrix-org/util.(*jsonRequestHandlerWrapper).OnIncomingRequest() github.com/matrix-org/util@v0.0.0-20200807132607-55161520e1d4/json.go:79 +0x54 github.com/matrix-org/util.MakeJSONAPI.func1() github.com/matrix-org/util@v0.0.0-20200807132607-55161520e1d4/json.go:141 +0xd4 github.com/matrix-org/util.Protect.func1() github.com/matrix-org/util@v0.0.0-20200807132607-55161520e1d4/json.go:103 +0xbe github.com/matrix-org/dendrite/internal/httputil.MakeExternalAPI.func1() net/http/server.go:2007 +0x365 net/http.HandlerFunc.ServeHTTP() net/http/server.go:2007 +0x51 github.com/gorilla/mux.(*Router).ServeHTTP() github.com/gorilla/mux@v1.7.3/mux.go:212 +0x13e github.com/gorilla/mux.(*Router).ServeHTTP() github.com/gorilla/mux@v1.7.3/mux.go:212 +0x13e net/http.serverHandler.ServeHTTP() net/http/server.go:2802 +0xce net/http.(*conn).serve() net/http/server.go:1890 +0x837 Goroutine 173 (running) created at: net/http.(*Server).Serve() net/http/server.go:2928 +0x5b5 net/http.(*Server).ListenAndServe() net/http/server.go:2825 +0x102 github.com/matrix-org/dendrite/internal/setup.(*BaseDendrite).SetupAndServeHTTP.func1() github.com/matrix-org/dendrite@/internal/setup/base.go:316 +0x178 Goroutine 572 (running) created at: net/http.(*Server).Serve() net/http/server.go:2928 +0x5b5 net/http.(*Server).ListenAndServe() net/http/server.go:2825 +0x102 github.com/matrix-org/dendrite/internal/setup.(*BaseDendrite).SetupAndServeHTTP.func1() github.com/matrix-org/dendrite@/internal/setup/base.go:316 +0x178 ================== ================== WARNING: DATA RACE Write at 0x00c0014dea48 by goroutine 173: github.com/matrix-org/dendrite/syncapi/internal.DeviceListCatchup() github.com/matrix-org/dendrite@/syncapi/types/types.go:118 +0xd90 github.com/matrix-org/dendrite/syncapi/sync.(*RequestPool).appendDeviceLists() github.com/matrix-org/dendrite@/syncapi/sync/requestpool.go:264 +0x1d1 github.com/matrix-org/dendrite/syncapi/sync.(*RequestPool).currentSyncForUser() github.com/matrix-org/dendrite@/syncapi/sync/requestpool.go:225 +0xacf github.com/matrix-org/dendrite/syncapi/sync.(*RequestPool).OnIncomingSyncRequest() github.com/matrix-org/dendrite@/syncapi/sync/requestpool.go:130 +0x1206 github.com/matrix-org/dendrite/syncapi/routing.Setup.func1() github.com/matrix-org/dendrite@/syncapi/routing/routing.go:46 +0x59 github.com/matrix-org/dendrite/internal/httputil.MakeAuthAPI.func1() github.com/matrix-org/dendrite@/internal/httputil/httpapi.go:63 +0x43f github.com/matrix-org/util.(*jsonRequestHandlerWrapper).OnIncomingRequest() github.com/matrix-org/util@v0.0.0-20200807132607-55161520e1d4/json.go:79 +0x54 github.com/matrix-org/util.MakeJSONAPI.func1() github.com/matrix-org/util@v0.0.0-20200807132607-55161520e1d4/json.go:141 +0xd4 github.com/matrix-org/util.Protect.func1() github.com/matrix-org/util@v0.0.0-20200807132607-55161520e1d4/json.go:103 +0xbe github.com/matrix-org/dendrite/internal/httputil.MakeExternalAPI.func1() net/http/server.go:2007 +0x365 net/http.HandlerFunc.ServeHTTP() net/http/server.go:2007 +0x51 github.com/gorilla/mux.(*Router).ServeHTTP() github.com/gorilla/mux@v1.7.3/mux.go:212 +0x13e github.com/gorilla/mux.(*Router).ServeHTTP() github.com/gorilla/mux@v1.7.3/mux.go:212 +0x13e net/http.serverHandler.ServeHTTP() net/http/server.go:2802 +0xce net/http.(*conn).serve() net/http/server.go:1890 +0x837 Previous read at 0x00c0014dea48 by goroutine 572: github.com/matrix-org/dendrite/syncapi/types.(*StreamingToken).IsAfter() github.com/matrix-org/dendrite@/syncapi/types/types.go:158 +0x2ba github.com/matrix-org/dendrite/syncapi/sync.(*UserDeviceStreamListener).GetNotifyChannel() github.com/matrix-org/dendrite@/syncapi/sync/userstream.go:139 +0x14b github.com/matrix-org/dendrite/syncapi/sync.(*RequestPool).OnIncomingSyncRequest() github.com/matrix-org/dendrite@/syncapi/sync/requestpool.go:110 +0xf8e github.com/matrix-org/dendrite/syncapi/routing.Setup.func1() github.com/matrix-org/dendrite@/syncapi/routing/routing.go:46 +0x59 github.com/matrix-org/dendrite/internal/httputil.MakeAuthAPI.func1() github.com/matrix-org/dendrite@/internal/httputil/httpapi.go:63 +0x43f github.com/matrix-org/util.(*jsonRequestHandlerWrapper).OnIncomingRequest() github.com/matrix-org/util@v0.0.0-20200807132607-55161520e1d4/json.go:79 +0x54 github.com/matrix-org/util.MakeJSONAPI.func1() github.com/matrix-org/util@v0.0.0-20200807132607-55161520e1d4/json.go:141 +0xd4 github.com/matrix-org/util.Protect.func1() github.com/matrix-org/util@v0.0.0-20200807132607-55161520e1d4/json.go:103 +0xbe github.com/matrix-org/dendrite/internal/httputil.MakeExternalAPI.func1() net/http/server.go:2007 +0x365 net/http.HandlerFunc.ServeHTTP() net/http/server.go:2007 +0x51 github.com/gorilla/mux.(*Router).ServeHTTP() github.com/gorilla/mux@v1.7.3/mux.go:212 +0x13e github.com/gorilla/mux.(*Router).ServeHTTP() github.com/gorilla/mux@v1.7.3/mux.go:212 +0x13e net/http.serverHandler.ServeHTTP() net/http/server.go:2802 +0xce net/http.(*conn).serve() net/http/server.go:1890 +0x837 Goroutine 173 (running) created at: net/http.(*Server).Serve() net/http/server.go:2928 +0x5b5 net/http.(*Server).ListenAndServe() net/http/server.go:2825 +0x102 github.com/matrix-org/dendrite/internal/setup.(*BaseDendrite).SetupAndServeHTTP.func1() github.com/matrix-org/dendrite@/internal/setup/base.go:316 +0x178 Goroutine 572 (running) created at: net/http.(*Server).Serve() net/http/server.go:2928 +0x5b5 net/http.(*Server).ListenAndServe() net/http/server.go:2825 +0x102 github.com/matrix-org/dendrite/internal/setup.(*BaseDendrite).SetupAndServeHTTP.func1() github.com/matrix-org/dendrite@/internal/setup/base.go:316 +0x178 ==================
This is the logs map in StreamingToken. IsAfter vs SetLog.
logs
StreamingToken
IsAfter
SetLog
This should be fixed in 38318b0.
While running a build from hash 6820b3e024474e2c44f7a0632261d2dc86257d77 with race detector enabled this was detected.