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 race conditions in the handling of notifications in events #2785

Merged
merged 5 commits into from
Sep 28, 2022

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Sep 27, 2022

Fix #2740

The logic of the handling of NotificationsInOpenCancel events wasn't correct, as it wasn't taking into account the fact that everything is asynchronous.

Copy link
Contributor

@mergify mergify bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatically approving tomaka's pull requests. This auto-approval will be removed once more maintainers are active.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 27, 2022

twiggy diff report

Difference in .wasm size before and after this pull request.


 Delta Bytes │ Item
─────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
        +529 ┊ alloc::collections::vec_deque::VecDeque<T,A>::remove::h64cb8873c5d0d31a
        +431 ┊ <alloc::collections::vec_deque::iter::Iter<T> as core::iter::traits::iterator::Iterator>::try_fold::h49d6da2e3ec09952
        +431 ┊ <alloc::collections::vec_deque::iter::Iter<T> as core::iter::traits::iterator::Iterator>::try_fold::h6165b42d6c2eb640
        +431 ┊ <alloc::collections::vec_deque::iter::Iter<T> as core::iter::traits::iterator::Iterator>::try_fold::ha73816f888478ff2
        +431 ┊ <alloc::collections::vec_deque::iter::Iter<T> as core::iter::traits::iterator::Iterator>::try_fold::hcd89ea5ca47d0b4d
        +238 ┊ smoldot::libp2p::collection::multi_stream::MultiStreamConnectionTask<TNow,TSubId>::inject_coordinator_message::hd0b380dc39946f9b
        +232 ┊ smoldot::libp2p::collection::single_stream::SingleStreamConnectionTask<TNow>::inject_coordinator_message::h73be97498bd58f97
        +225 ┊ alloc::collections::vec_deque::ring_slices::RingSlices::ring_slices::h235a162b4f5016ba
        +207 ┊ smoldot::libp2p::collection::single_stream::SingleStreamConnectionTask<TNow>::read_write::hdd1e9738be45c96f
        +202 ┊ alloc::raw_vec::RawVec<T,A>::grow_exact::h2350a0a37796c9f8
        +190 ┊ alloc::collections::vec_deque::VecDeque<T,A>::grow::h3c1dbef57f5fbb20
        +181 ┊ alloc::raw_vec::RawVec<T,A>::allocate_in::h999a7bd428ffe01d
        +153 ┊ alloc::collections::vec_deque::VecDeque<T,A>::with_capacity_in::h4b6192ee4a9898dd
        +144 ┊ core::iter::traits::iterator::Iterator::try_fold::h12c43889f2c5f49c
        +144 ┊ core::iter::traits::iterator::Iterator::try_fold::h1a738d31696391f2
        +144 ┊ core::iter::traits::iterator::Iterator::try_fold::h50bcb3f2963322bc
        +144 ┊ core::iter::traits::iterator::Iterator::try_fold::h9930791007ccfc4a
        +128 ┊ core::ptr::drop_in_place<smoldot::libp2p::collection::multi_stream::MultiStreamConnectionTaskInner<smoldot_light_wasm::Instant,usize>>::h13f2d4abdde67d43
        +127 ┊ core::ptr::drop_in_place<smoldot::libp2p::collection::single_stream::SingleStreamConnectionTaskInner<smoldot_light_wasm::Instant>>::h889741b3e313729b
        -116 ┊ core::ptr::drop_in_place<smoldot::libp2p::collection::multi_stream::MultiStreamConnectionTaskInner<smoldot_light_wasm::Instant,usize>>::hee91e08202f36002
       +1201 ┊ ... and 30 more.
       +9498 ┊ Σ [50 Total Rows]

Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Sep 28, 2022
@mergify mergify bot merged commit b8b194a into paritytech:main Sep 28, 2022
@tomaka tomaka deleted the fix-2740 branch September 28, 2022 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge pull request as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic at single_stream
2 participants