pydio / cells

Future-proof content collaboration platform
https://pydio.com
GNU Affero General Public License v3.0
1.77k stars 172 forks source link

data race fixing. #535

Closed chaosue closed 5 months ago

chaosue commented 6 months ago

data race happens when stopping server.

2024-02-22T10:41:09.788+0800    INFO    pydio.grpc.activity Stopping ACL Debouncer
2024-02-22T10:41:09.788+0800    ERROR   pydio.grpc.tasks    fatal error: concurrent map writes
2024-02-22T10:41:09.791+0800    ERROR   pydio.grpc.tasks
2024-02-22T10:41:09.791+0800    ERROR   pydio.grpc.tasks    goroutine 257 [running]:
2024-02-22T10:41:09.791+0800    ERROR   pydio.grpc.tasks    github.com/pydio/cells/v4/common/broker/grpcpubsub.(*sharedSubscriber).Unsubscribe(0xc001d5cd20, {0xc001d50600, 0x24})
2024-02-22T10:41:09.791+0800    ERROR   pydio.grpc.tasks        github.com/pydio/cells/v4/common/broker/grpcpubsub/client.go:78 +0xd7
2024-02-22T10:41:09.791+0800    ERROR   pydio.grpc.tasks    github.com/pydio/cells/v4/common/broker/grpcpubsub.NewSubscription.func1()
2024-02-22T10:41:09.791+0800    ERROR   pydio.grpc.tasks        github.com/pydio/cells/v4/common/broker/grpcpubsub/client.go:336 +0x1f
2024-02-22T10:41:09.791+0800    ERROR   pydio.grpc.tasks    github.com/pydio/cells/v4/common/broker/grpcpubsub.(*subscription).Close(0xc000ee1f28?)
2024-02-22T10:41:09.791+0800    ERROR   pydio.grpc.tasks        github.com/pydio/cells/v4/common/broker/grpcpubsub/client.go:421 +0x18
2024-02-22T10:41:09.791+0800    ERROR   pydio.grpc.tasks    gocloud.dev/pubsub.(*Subscription).Shutdown(0xc000202d20, {0x94994a0?, 0xc001e2a640?})
2024-02-22T10:41:09.791+0800    ERROR   pydio.grpc.tasks        gocloud.dev@v0.20.0/pubsub/pubsub.go:693 +0x297
2024-02-22T10:41:09.791+0800    ERROR   pydio.grpc.tasks    github.com/pydio/cells/v4/common/broker.(*broker).Subscribe.func3()
2024-02-22T10:41:09.791+0800    ERROR   pydio.grpc.tasks        github.com/pydio/cells/v4/common/broker/broker.go:313 +0x1f
2024-02-22T10:41:09.792+0800    ERROR   pydio.grpc.tasks    github.com/pydio/cells/v4/common/broker.SubscribeCancellable.func1()
2024-02-22T10:41:09.792+0800    ERROR   pydio.grpc.tasks        github.com/pydio/cells/v4/common/broker/broker.go:139 +0x36
2024-02-22T10:41:09.792+0800    ERROR   pydio.grpc.tasks    created by github.com/pydio/cells/v4/common/broker.SubscribeCancellable in goroutine 226
2024-02-22T10:41:09.792+0800    ERROR   pydio.grpc.tasks        github.com/pydio/cells/v4/common/broker/broker.go:137 +0xc5
2024-02-22T10:41:09.792+0800    ERROR   pydio.grpc.tasks
cdujeu commented 6 months ago

Hi @chaosue thanks for reporting and proposing fixes.

We will take some time to review your changes (and your other tickets ;-). Not sure it will be batched in 4.3.6 but the following one maybe.

Thanks for your patience ! Charles