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 starting requests on shutting down connections #2847

Merged
merged 6 commits into from
Oct 11, 2022

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Oct 10, 2022

Fixes a TODO left in the code. I'm slowing catching up on networking TODOs.

Fix #2777
Fix #2841

This PR changes has_established_connection to return false if all the connections are shutting down.
To clear up any ambiguity, I've also renamed it to can_start_requests, because determining whether we can send requests is the reason why this function is called.

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 Oct 10, 2022

twiggy diff report

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


 Delta Bytes │ Item
─────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────
        +104 ┊ <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold::h903a2ef4d4916159
         -61 ┊ smoldot::network::service::ChainNetwork<TNow>::has_established_connection::h0a2ba2c3ffa39079
         +60 ┊ smoldot::libp2p::peers::Peers<TConn,TNow>::can_start_requests::h21daa631f106677d
         +32 ┊ <either::Either<L,R> as core::iter::traits::iterator::Iterator>::any::hd5950a8403797e19
          +6 ┊ type[23]: (i32, i64) -> i32
          -6 ┊ type[23]: (i64, i32) -> i64
          +6 ┊ type[24]: (i64, i32) -> i64
          -6 ┊ type[25]: (i32, i64) -> i32
          -5 ┊ type[24]: (i32, i64) -> nil
          +5 ┊ type[25]: (i32, i64) -> nil
        +386 ┊ Σ [10 Total Rows]

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Oct 11, 2022
@mergify mergify bot merged commit 39be8a6 into paritytech:main Oct 11, 2022
@tomaka tomaka deleted the fix-rq-start-shutdown branch October 11, 2022 12:18
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.

Kusama connection caused Panic in service.rs Smoldot Panic Error while connecting to substrate connect
1 participant