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

Fix handling of IO WouldBlock error in Stratum server #2528

Merged
merged 1 commit into from Feb 12, 2019

Conversation

hashmap
Copy link
Contributor

@hashmap hashmap commented Feb 4, 2019

If WouldBlock error happens Stratum server drops part of a message to
read or write. This PR introduces a worker's buffer to store partially
read message which will be completed next time. For write the existing
util function is used.
Fixes #2524

If WouldBlock error happens Stratum server drops part of a message to
read or write. This PR inroduces a worker's buffer to store partially
read message which will be completed next time. For write the existing
util function is used.
Fixes mimblewimble#2524
@hashmap hashmap added the bug label Feb 6, 2019
@hashmap hashmap added this to the 1.0.2 milestone Feb 7, 2019
Copy link
Contributor

@ignopeverell ignopeverell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks cleaner to me as well.

@hashmap hashmap merged commit 65c0b1e into mimblewimble:master Feb 12, 2019
@hendi
Copy link
Member

hendi commented Feb 15, 2019

@hashmap
Blade and I can't actually find any code in the fix that handles a partial read or completes the next time
It just seems to add an extra buffer

Could you explain it a bit please? :-)

@hashmap
Copy link
Contributor Author

hashmap commented Feb 15, 2019

@hendi that’s the purpose of the buffer. It’s a long lived object, if we read the entire line we clear the buffer and return content. If we read a part of the line and about to block we exit and read the rest to the same buffer on the next round. Does it make sense?

@hashmap
Copy link
Contributor Author

hashmap commented Feb 15, 2019

Worth mentioning that read_line appends to the provided buffer

@hashmap hashmap deleted the stratum-io-block-error branch April 4, 2019 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants