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.
Is it necessary to record expected sleep interval which is actually a random value.
There was a problem hiding this comment.
Yeah, it's more like a debug log, but I think it's necessary to output it in info level if actual > expected.
|
|
||
| // 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.
I think we should abstract an interface for client writer, WDYT?
There was a problem hiding this comment.
agreed, there is an ambitious plan to do this, but not in this pr.
|
LGTM. |
|
Well, I think I understand what you want to do, and LGTM for this PR. |
DONE |
Signed-off-by: lowzj <[email protected]>
Signed-off-by: lowzj [email protected]
Ⅰ. 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