Skip to content

Lookout: a steer can take a completion whose reply is still being read, dropping the reply #359

Closed

Description

@lydakis

From Codex's review of #310. A steer goes out as soon as the person's words in a task have been read, without waiting for the other reads under way (reading). If a task's turn-end reply is still being fetched at that moment, Updates::take() puts the completion into the steer without its reply. When the read returns, Updates::replied() finds no pending news to attach it to and drops it. The lead hears that the turn ended, with no reply, and can still read it with wait. A resting lead's note has the same gap once SETTLE_MAX (15 s) runs out while a read is still in flight.

The race is narrow, because a reply read is a couple of local history calls. A fix: keep the turns whose reply is being read in a set in Updates, have take() leave those turns pending, and have replied() always clear its turn from the set, whether or not the read found any text, so a failed read never holds a turn.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions