Closed
Description
Currently java-control-plane uses an EmitterProcessor
to notify subscribers that a watch has changed. Since this executes the the subscription callbacks synchronously, we end up spending a substantial time constructing the gRPC responses while holding the SimpleCache write lock during setSnapshot
, essentially making the cache inaccessible until all the watches have been triggered.
It would be nice to use an async processor instead (maybe WorkQueueProcessor
?) which would allow us to decouple the response construction from watch triggers, reducing overall lock contention.
Spent a bit of time figuring this out but ran into some deadlocks and issues in test, so filing this for now to track the the issue in case anyone else runs into this.
Metadata
Metadata
Assignees
Labels
No labels