Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 8 commits into from
Jan 4, 2024

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
3 checks passed
@de-sh de-sh deleted the fix-pending branch January 4, 2024 13:09
de-sh pushed 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