Skip to content

Respond to watches in parallel #59

Closed
@snowp

Description

@snowp

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions