tari-project / tari

The Tari protocol
https://tari.com
BSD 3-Clause "New" or "Revised" License
350 stars 218 forks source link

fix(comms): always send disconnect notification to conn manager #6511

Closed sdbondi closed 2 months ago

sdbondi commented 2 months ago

Description

fix(comms): always send disconnect notification to conn manager fix(comms): take the connection state into account when determining connectedness for tie-breaking

Motivation and Context

Previously, if Yamux detected that we were disconnected, the connectivity manager Disconnected notification would not be sent. A race condition with disconnects on a connection and the remote disconnecting happen at almost the same time. If the latter happens first, then the notification of the disconnect would not be sent to the connection manager. When a new connection is attempted, the connection manager would think that a previous connection exists.

Ref #6512 Ref https://github.com/tari-project/tari/issues/6513

How Has This Been Tested?

Not explicitly tested, difficult to reproduce.

What process can a PR reviewer use to test or verify this change?

Breaking Changes

github-actions[bot] commented 2 months ago

Test Results (CI)

    3 files    129 suites   38m 7s :stopwatch: 1 306 tests 1 306 :white_check_mark: 0 :zzz: 0 :x: 3 904 runs  3 904 :white_check_mark: 0 :zzz: 0 :x:

Results for commit b07794ee.

github-actions[bot] commented 2 months ago

Test Results (Integration tests)

 2 files  + 2  11 suites  +11   35m 31s :stopwatch: + 35m 31s 36 tests +36  34 :white_check_mark: +34  0 :zzz: ±0  2 :x: +2  39 runs  +39  36 :white_check_mark: +36  0 :zzz: ±0  3 :x: +3 

For more details on these failures, see this check.

Results for commit b07794ee. ± Comparison against base commit 169572aa.