Skip to content

fix: ensure pending packets are not lost on EventLoop::clean#780

Merged
de-sh merged 8 commits intomainfrom
fix-pending
Jan 4, 2024
Merged

fix: ensure pending packets are not lost on EventLoop::clean#780
de-sh merged 8 commits intomainfrom
fix-pending

Conversation

@de-sh
Copy link
Contributor

@de-sh de-sh commented Dec 31, 2023

Situation earlier:

  1. EventLoop has pending packets yet to be processed.
  2. EventLoop::clean is called.
  3. EventLoop::poll has lost some packets which were earlier pending.

This can be solved with a queue in place of the pending iter.

Type of change

Checklist:

  • Formatted with cargo fmt
  • Make an entry to CHANGELOG.md if it's relevant to the users of the library. If it's not relevant mention why. (Do we need to do this when the release hasn't been made yet?)

@de-sh de-sh merged commit c63de08 into main Jan 4, 2024
@de-sh de-sh deleted the fix-pending branch January 4, 2024 13:09
de-sh added a commit that referenced this pull request Jan 4, 2024
…n` (#780)

    BREAKING: `EventLoop.pending` uses a `VecDeque` instead of `IntoIter`

    * fix: use `Vec::extend` to not lost pending

    * refactor: remove unnecessary unwrap

    * style: clippy suggestions

    * doc: note unchecked growth of pending

    * fix: `VecDeque` preserves ordering

    Also reverts 8406c4c

    * doc: note for `EventLoop::clean`

    * fix: same bug in `mod v5`

    * doc: add changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants