Non-blocking send#160
Open
zuiderkwast wants to merge 7 commits intoEricsson:single-process-clientfrom
Open
Conversation
Use send_timeout 0. If send returns timeout, it has still queued all the data for sending later. When this happens, backoff and don't send more to the socket until the pending commands have got replies from the server. Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
1c0372e to
f261be5
Compare
Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Collaborator
Author
|
Related discussion about this behavior of the inet driver: |
bjosv
approved these changes
Mar 17, 2026
Collaborator
bjosv
left a comment
There was a problem hiding this comment.
LGTM, seems to be helpful
WilliamVoong
requested changes
Mar 17, 2026
Collaborator
WilliamVoong
left a comment
There was a problem hiding this comment.
Hi i think most of it looks good, just have a small comment in ered_client_tests.erl.
Collaborator
Author
|
Some more context. If we use blocking send, the process can become unresponsive and we can get a deadlock. See the discussion here: #157 (comment) |
Co-authored-by: Hippo <44473866+WilliamVoong@users.noreply.github.com>
…blocking-send # Conflicts: # src/ered_client.erl
Parametrize send_backoff_t with a Transport argument (gen_tcp or ssl)
and run both variants. The TLS variant is skipped on OTP 28.0 .. 28.4
(ssl 11.2.0 .. 11.5.2) where {send_timeout, 0} incorrectly closes the
ssl socket on timeout. This was fixed in ssl-11.5.3 (OTP-20018).
Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use send_timeout 0. If send returns timeout, it has still queued all the data for sending later. When this happens, backoff and don't send more to the socket until the pending commands have got replies from the server.