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

Make send thread-safe with asio strand #171

Closed
wants to merge 5 commits into from

Conversation

alesapin
Copy link
Contributor

I'm not sure that this one is the best possible solution. This check was introduced in #106, but the peer's busy flag doesn't cover all possible ways to call send in asio_service. Fixes #169.

@alesapin
Copy link
Contributor Author

Still have a race condition in asio https://gist.github.com/alesapin/3f09d3fad35bb95f2f2753be7b859022 :(

@greensky00
Copy link
Contributor

Please refer to my comment
#169 (comment)

Multiple messages can't be sent to the same peer at the same time by design.

@alesapin alesapin marked this pull request as draft January 29, 2021 21:03
@alesapin alesapin changed the title Wait busy socket in asio_service Make send thread-safe with asio strand Jan 30, 2021
@alesapin
Copy link
Contributor Author

As discussed in #169 these changes don't help and only hide the error.

@alesapin alesapin closed this Jan 31, 2021
@nicelulu
Copy link
Contributor

Multiple messages can't be sent to the same peer at the same time by design.

@greensky00 Perhaps this restriction can be relaxed for the following request? auto_forwarding_= true and follower's request to the leader and the requested msg_type is msg_type::client_request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

socket is already in use, race happened on connection to node1:44444
3 participants