-
Notifications
You must be signed in to change notification settings - Fork 184
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(iroh-gossip): do not drop existing peer connection when we get incoming one #2310
Conversation
703a6ad
to
24a9c2f
Compare
iroh-gossip/src/net.rs
Outdated
loop { | ||
tokio::select! { | ||
biased; | ||
msg = send_rx.recv() => { | ||
msg = send_rx.recv(), if tx_open => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be done with send_rx.is_closed()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have force-pushed already, but is_closed()
looks better IMO.
24a9c2f
to
2b36b59
Compare
2b36b59
to
45d3fc0
Compare
This looks sensible to me! When rereading the connection handling in |
This also should be merged to the main besides maint-0.16, but for delta chat would be nice to have it at least as a 0.16 bugfix release, then there is a chance we get (disabled-by-default) realtime channels in the next desktop release. |
The breaking changes on |
Replaced with #2318 which is based on main |
Otherwise if two peers try to connect to each other at the same time, they may end up creating two connection and then closing both of them. Better keep two one-directional connections.
deltachat-core-rust will have a downstream test that reliably triggers the problem at deltachat/deltachat-core-rust#5595
I did not manage to reproduce the problem in Rust, it seems to depend on timing and is triggered in the test which sends tickets around using SMTP.
Fixes #2307
Replaces #2308