Skip to content

Log client: WaitForRootUpdate "stuck" with concurrent calls to AddLeaf #3294

@gpdionisio

Description

@gpdionisio

If LogClient.AddLeaf is called concurrently (and thus multiple leaves are queued, and then processed together in a single pass of the operation manager), when the LogClient.root is updated, only one of the concurrent calls to WaitForRootUpdate successfully return.

When the other goroutines reach LogClient.UpdateRoot the new trusted root of the client is already updated, therefore they keep waiting in WaitForRootUpdate until either a new leaf is added, or the context expires/is canceled.

This commit reproduces the behavior in a unit test: gpdionisio@8acb052

This commit is a proposed fix: gpdionisio@d0f7ad2

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