Skip to content
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

Separate peer queue and write handling. #63

Closed
davecgh opened this issue Dec 17, 2013 · 1 comment
Closed

Separate peer queue and write handling. #63

davecgh opened this issue Dec 17, 2013 · 1 comment

Comments

@davecgh
Copy link
Member

davecgh commented Dec 17, 2013

Per discussions on IRC with @owainga and @drahn, the current blockmanager/peer design is such that a slow peer can cause slowness amongst the overall system. The proposed solution is to split the current outHandler goroutine into 2. One, to be named, queueHandler where most of the current outHandler logic moves into it, and a new outHandler. The queueHandler will act as the 'traffic cop' between block manager queuing items to be sent and the new outHandler which actually sends the item to the socket and notifies the queueHandler when it has been written so it can provide the next item to be written. This will allow all queuing to happen quickly, and independent of the peer's speed, so block manager is not bogged down by slow peers.

In conjunction with this, a mechanism is needed to prevent the queue from growing too large on slow peers by either signalling the block manager to stop sending new stuff until the peer catches up, or worst case, disconnecting the peer.

@davecgh
Copy link
Member Author

davecgh commented Jan 3, 2014

This was closed by commit d3a7f15.

@davecgh davecgh closed this as completed Jan 3, 2014
@ghost ghost assigned owainga Jan 13, 2014
gsalgado pushed a commit to gsalgado/btcd that referenced this issue Jul 29, 2014
davecgh pushed a commit to davecgh/btcd that referenced this issue Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants