-
Notifications
You must be signed in to change notification settings - Fork 774
bugfix: notify p2p downloader to pull next piece after reporting #1308
Conversation
p2p.maxTimeout *= 2 | ||
} | ||
actual, expected := p2p.sleepInterval() | ||
logrus.Infof("pull piece task(%+v) result:%s and sleep actual:%.3fs expected:%.3fs", |
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.
Is it necessary to record expected sleep interval which is actually a random value.
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.
Yeah, it's more like a debug
log, but I think it's necessary to output it in info
level if actual > expected
.
@@ -68,11 +71,12 @@ type ClientStreamWriter struct { | |||
} | |||
|
|||
// NewClientStreamWriter creates and initialize a ClientStreamWriter instance. | |||
func NewClientStreamWriter(clientQueue queue.Queue, api api.SupernodeAPI, cfg *config.Config) *ClientStreamWriter { | |||
func NewClientStreamWriter(clientQueue, notifyQueue queue.Queue, api api.SupernodeAPI, cfg *config.Config) *ClientStreamWriter { |
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 think we should abstract an interface for client writer, WDYT?
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.
agreed, there is an ambitious plan to do this, but not in this pr.
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.
OK
LGTM. |
Well, I think I understand what you want to do, and LGTM for this PR. |
DONE |
Signed-off-by: lowzj <zj3142063@gmail.com>
Signed-off-by: lowzj zj3142063@gmail.com
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
fixes #1307
should be merged into branch:
master
,1.0.x
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews