Skip to content

async_receive2: race conditions on incomplete messages #369

@anarthal

Description

@anarthal

(Translating here a Slack conversation)

There is a potential race condition with async_receive2 as it is now:

  • The server sends many pushes in a packet. Let's say 10, but the last one (the 10th) is incomplete. Some nodes for the 10th push are in the receive response, and some others aren't.
  • Since there is at least one complete push, async_receive2 completes.
  • User code ends up calling .clear()
  • The final nodes for the 10th push are received. You now have an incomplete message delivered to the user

This is likely an indication that a plain generic_flat_response is too low-level to be used directly in PubSub.

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