Skip to content

CloseableCursor implementation is racey #181

@Diggsey

Description

@Diggsey

This is only used by the test suite, but it can cause tests to randomly fail, which is a problem.

The issue is the lack of synchronization between the stored waker and the state of the cursor.

There are a few possible fixes:

  1. Use a single lock around the entire cursor state, instead of per-field locks.
  2. Store the waker before performing any operation which might block, or at least re-check if the operation can succeed after storing the waker.
  3. Look for a prebuilt solution, it seems like something like this should exist in futures or elsewhere.

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