Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Update registration after every write #4102

Merged
merged 1 commit into from
Jan 10, 2017
Merged

Update registration after every write #4102

merged 1 commit into from
Jan 10, 2017

Conversation

arkpar
Copy link
Collaborator

@arkpar arkpar commented Jan 10, 2017

Should fix #2668

@arkpar arkpar added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jan 10, 2017
}
io.update_registration(self.token)?;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This fixes a race condition when the sending queue is being processed and another packet is added to the queue. The registration might have not been updated in such case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not too clear on the mio specifics, but does it cause any issues to reregister interest multiple times before a timeout or notify event is handled? I thought that was the original purpose of waiting until the send queue was empty.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Calling reregister multiple times is perfectly fine.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling ce2154b on net-send-reg-update into ** on master**.

@rphmeier rphmeier added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jan 10, 2017
@arkpar arkpar merged commit d67ceec into master Jan 10, 2017
@arkpar arkpar deleted the net-send-reg-update branch January 10, 2017 11:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connections between peers on a private testnet drop for no apparent reason
3 participants