owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.42k stars 183 forks source link

[stable-5] ocis crashes with `fatal error: concurrent map iteration and map write` #8255

Closed saw-jan closed 10 months ago

saw-jan commented 10 months ago

ocis crashed:

fatal error: concurrent map iteration and map write

goroutine 998 [running]:
github.com/cs3org/reva/v2/pkg/publicshare/manager/json.(*manager).cleanupExpiredShares(0xc0031d3800)
    /drone/src/vendor/github.com/cs3org/reva/v2/pkg/publicshare/manager/json/json.go:557 +0xff
github.com/cs3org/reva/v2/pkg/publicshare/manager/json.(*manager).startJanitorRun(0xc0031d3800)
    /drone/src/vendor/github.com/cs3org/reva/v2/pkg/publicshare/manager/json/json.go:191 +0xe5
created by github.com/cs3org/reva/v2/pkg/publicshare/manager/json.New in goroutine 577
    /drone/src/vendor/github.com/cs3org/reva/v2/pkg/publicshare/manager/json/json.go:132 +0x138

goroutine 1 [IO wait, 2 minutes]:
internal/poll.runtime_pollWait(0x7f7fb4811160, 0x72)
    /usr/local/go/src/runtime/netpoll.go:343 +0x85
internal/poll.(*pollDesc).wait(0xc001b88a80?, 0xc003a974b0?, 0x0)

======

goroutine 126407 [runnable]:
encoding/json.unquoteBytes({0xc0058346bc, 0x3ab, 0x11944})
    /usr/local/go/src/encoding/json/decode.go:1208 +0x18e
encoding/json.unquote(...)
    /usr/local/go/src/encoding/json/decode.go:1174
encoding/json.(*decodeState).literalInterface(0xc005b9eab0)
    /usr/local/go/src/encoding/json/decode.go:1130 +0xa7
encoding/json.(*decodeState).valueInterface(0xc005b9eab0?)
    /usr/local/go/src/encoding/json/decode.go:1032 +0x7b
encoding/json.(*decodeState).objectInterface(0xc005b9eab0)
    /usr/local/go/src/encoding/json/decode.go:1096 +0x12f
encoding/json.(*decodeState).object(0xc005b9eab0, {0x2bc5540?, 0xc004975560?, 0x0?})
    /usr/local/go/src/encoding/json/decode.go:616 +0x5bf
encoding/json.(*decodeState).value(0xc005b9eab0, {0x2bc5540?, 0xc004975560?, 0x2afad60?})
    /usr/local/go/src/encoding/json/decode.go:374 +0x3e
encoding/json.(*decodeState).object(0xc005b9eab0, {0x2a999e0?, 0xc0031d2970?, 0x13baf8c?})
    /usr/local/go/src/encoding/json/decode.go:755 +0xd08
encoding/json.(*decodeState).value(0xc005b9eab0, {0x2a999e0?, 0xc0031d2970?, 0x7f7ffb6035b8?})
    /usr/local/go/src/encoding/json/decode.go:374 +0x3e
encoding/json.(*decodeState).unmarshal(0xc005b9eab0, {0x2a999e0?, 0xc0031d2970?})
    /usr/local/go/src/encoding/json/decode.go:181 +0x133
encoding/json.Unmarshal({0xc00581c000, 0x26f14, 0x2a000}, {0x2a999e0, 0xc0031d2970})
    /usr/local/go/src/encoding/json/decode.go:108 +0x111
github.com/cs3org/reva/v2/pkg/publicshare/manager/json/persistence/cs3.(*cs3).Read(0xc0031d2940, {0x4500470, 0xc003e22d20})
    /drone/src/vendor/github.com/cs3org/reva/v2/pkg/publicshare/manager/json/persistence/cs3/cs3.go:88 +0x1a8
github.com/cs3org/reva/v2/pkg/publicshare/manager/json.(*manager).GetPublicShareByToken(0xc0031d3800, {0x4500470, 0xc003e22d20}, {0xc005e920a0, 0xf}, 0x30?, 0x1)
    /drone/src/vendor/github.com/cs3org/reva/v2/pkg/publicshare/manager/json/json.go:649 +0x8d
github.com/cs3org/reva/v2/internal/grpc/services/publicshareprovider.(*service).GetPublicShareByToken(0xc00529fa40, {0x4500470, 0xc003e22d20}, 0xc0046ca370)
    /drone/src/vendor/github.com/cs3org/reva/v2/internal/grpc/services/publicshareprovider/publicshareprovider.go:386 +0xcb
github.com/cs3org/go-cs3apis/cs3/sharing/link/v1beta1._LinkAPI_GetPublicShareByToken_Handler.func1({0x4500470, 0xc003e22d20}, {0x3033aa0?, 0xc0046ca370})
    /drone/src/vendor/github.com/cs3org/go-cs3apis/cs3/sharing/link/v1beta1/link_api.pb.go:1437 +0x72

Similar https://github.com/owncloud/ocis/issues/8171, https://github.com/owncloud/ocis/issues/7697

ScharfViktor commented 10 months ago

I guest it should be fixed after merging https://github.com/owncloud/ocis/pull/8207

2403905 commented 10 months ago

@saw-jan If it happened in a CI, please attach a link or logs dump.

saw-jan commented 10 months ago

@saw-jan If it happened in a CI, please attach a link or logs dump.

Sorry that I missed the ci build link. here is the one: https://drone.owncloud.com/owncloud/ocis/31136/34/3 (logs should be there)