-
Notifications
You must be signed in to change notification settings - Fork 17
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
Better reconnect behaviour #162
Conversation
Codecov Report
@@ Coverage Diff @@
## master #162 +/- ##
==========================================
+ Coverage 65.78% 65.82% +0.03%
==========================================
Files 23 23
Lines 2455 2446 -9
==========================================
- Hits 1615 1610 -5
Misses 506 506
+ Partials 334 330 -4
Continue to review full report at Codecov.
|
@@ -30,9 +30,3 @@ const ErrRejected = errorType("response rejected") | |||
|
|||
// ErrUnsupported indicates an operation is not supported by the transport protocol | |||
const ErrUnsupported = errorType("unsupported") | |||
|
|||
// ErrDisconnected indicates the other peer may have hung up and you should try restarting the channel. | |||
const ErrDisconnected = errorType("other peer appears to have hung up. restart Channel") |
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.
ErrDisconnected and ErrRemoved are no longer used (with this PR we try to reconnect automatically)
@@ -36,19 +34,6 @@ func (m *manager) OnDataReceived(chid datatransfer.ChannelID, link ipld.Link, si | |||
return err | |||
} | |||
|
|||
m.reconnectsLk.RLock() |
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.
Remove code that watches for the connection going down and coming up again, this is now handled by the channel monitor
@@ -85,75 +85,6 @@ func TestDataTransferInitiating(t *testing.T) { | |||
testutil.AssertFakeDTVoucher(t, receivedRequest, h.voucher) | |||
}, | |||
}, | |||
"Remove Timed-out request": { |
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.
These tests were for connection monitoring, which has now been removed in favour of the push / pull channel monitors
t.dataLock.Lock() | ||
defer t.dataLock.Unlock() | ||
|
||
chid, ok := t.graphsyncRequestMap[graphsyncKey{request.ID(), p}] | ||
if ok { |
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.
Firing a Disconnect event here would cause go-fil-markets to fail the deal.
Instead we fire a SendDataError which the push / pull monitor listen for - they will attempt to reconnect and restart the channel
Fixes #160 #154 #156