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 #2618 #2620

Merged
merged 4 commits into from
Aug 12, 2022
Merged

Fix #2618 #2620

merged 4 commits into from
Aug 12, 2022

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Aug 12, 2022

Fix #2618

It turns out that when a handshake timeout or protocol error happens, we set the connection's state to ShutdownWaitingAck { was_api_reset: false }.

was_api_reset: false indicates that the shutdown wasn't initiated through the public API.

Unfortunately, other parts of the code interpret was_api_reset: false as meaning "was initiated through the coordinator", as it assumes that a shutdown is only ever initiated either through the public API or through the coordinator.

This omits the third way to start a shutdown: when a handshake timeout or protocol error happens.

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 Aug 12, 2022

twiggy diff report

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


 Delta Bytes │ Item
─────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
        +145 ┊ core::ptr::drop_in_place<smoldot::libp2p::collection::multi_stream::MultiStreamConnectionTaskInner<smoldot_light_wasm::Instant,usize>>::h532ca1a6e5541b2f
        -145 ┊ core::ptr::drop_in_place<smoldot::libp2p::collection::multi_stream::MultiStreamConnectionTaskInner<smoldot_light_wasm::Instant,usize>>::hf3ca70f950db27ac
        +116 ┊ core::ptr::drop_in_place<smoldot::libp2p::collection::single_stream::SingleStreamConnectionTaskInner<smoldot_light_wasm::Instant>>::h51b347099058c3a5
        -116 ┊ core::ptr::drop_in_place<smoldot::libp2p::collection::single_stream::SingleStreamConnectionTaskInner<smoldot_light_wasm::Instant>>::h646874b33410ba30
         +33 ┊ smoldot::libp2p::collection::single_stream::SingleStreamConnectionTask<TNow>::inject_coordinator_message::h5ab2a482efb3be3c
          +1 ┊ smoldot::libp2p::collection::single_stream::SingleStreamConnectionTask<TNow>::read_write::h44de02e833671f05
         +34 ┊ Σ [6 Total Rows]

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Aug 12, 2022
@mergify mergify bot merged commit dca4894 into paritytech:main Aug 12, 2022
@tomaka tomaka deleted the fix-2618 branch August 12, 2022 12:17
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.

internal error: entered unreachable code in single_stream.rs
1 participant