-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
iperf_udp: implement UDP connect retry mechanism #1144
base: master
Are you sure you want to change the base?
Conversation
Sometimes the single UDP datagram sent as a form of "connection init" gets lost on the way. A common example is testing over wifi, or more specifically in our case testing many parallel udp connections. When this happens the recv() call on the client times out after 30 seconds and the test is unsuccessful. This commit implements a very basic retry mechanism for this. Using select() calls with a timeout of 1 second we attempt to send the "connection init" datagram up to 5 times and expect a reply from the server. If this fails the test fails earlier reporting issues with initializing the connection. Otherwise the test proceeds as before. Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
@olichtne , could you please update this pull request with a fix of uninitialized
Without this patch I get following error on aarch64:
|
Suggested-by: Jan Tluka <jtluka@redhat.com Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had the same issue with multiple processes, we tried this PR and it works with small modification that addressed in the comments.
that sounds a little suspicious, i'm not sure how |
This may not have been merged yet, but thank you for posting it, it saved my bacon today. I have a suggestion, rather than hardcoding the number of retry attempts to five, set a default value and then make it a flag that can be passed from the command line to override the default. Thanks! |
On second thought, there is more to this. While testing using this today I discovered that the iperf3 UDP client just silently finishes the test even though there's 0 packets sent. Maybe more is required. |
yeah, for our internal use, we keep using the fix from this PR that we have in a separate branch. Since this didn't get more of a response from the maintainers of this project I didn't really look much deeper into this yet as I don't want to mess up any internals accidentally... I do agree though on the cli argument being more comfortable for a real solution... Not sure what you mean by your case of UDP client silently finishing with 0 packets sent, I think that may need more information/reproducer data to understand, and may potentially be a new issue completely. |
I like the approach suggested by this PR, but I think that the above is the main issue with it and that the Stream creation protocol should be changed to make this suggestion feasible for general use. If I understand
The suggested approach probably works well when only the upload interface (client to server) is loaded, so the chance of loosing the the server's reply is low. Note that a less elegant solution to the issue may be by running the client in a shell-script loop. |
right, reading the explanation basically confirms that i don't entirely understand how the initiation protocol works which is why i didn't push for this harder. But now after reading this explanation I am kind of questioning if this initiation protocol should even be in place this way for UDP. To me thinking about it from an outside view of what I would expect for a UDP test is that a perf measurement tool would:
The point of this being that the UDP connections are not actual connections, and they're not established as part of the UDP protocol. You directly use them to measure their performance from the start. In a situation that the udp packets don't arrive at the server you simply report:
And close the connections on both sides via the control connection. In my eyes, this situation is completely valid, it also would mean that since there is no "connection" creation it doesn't have to be retried. |
I have submitted PR #1402 which should be an enhancement of this PR. Although my system does not have the issues solved by the PR, I hope it is sufficiently tested. Of course, it will help if the new PR will be tested on systems that does have this issues. |
Version of iperf3 (or development branch, such as
master
or3.1-STABLE
) to which this pull request applies:master
Issues fixed (if any): from our investigation we encountered issue iperf3 error :unable to read from stream socket: Resource temporarily unavailable #862 and this is an attempt to resolve that issue.
Brief description of code changes (suitable for use as a commit message):
This implements a simple retry mechanism for the
iperf_udp_connect
function using a static iteration loop with a select call and attempting to resend the connect datagram.This is mostly as a suggestion for a fix, there's probably a better way to implement some parts of this, for example the number of iterations should probably be either a constant or could be a new cli argument that could change the value. The retry mechanism could also be optionally disabled. Another idea is that the timeout value for the
select
function could also be configurable, a 1 second wait here may not always be a good idea depending on the specific network that is being measured.1I'm also not 100% sure if this doesn't potentially have side effects for the test initialization state transition on the slave side in case the connect datagram is not in fact lost and instead the reply is delayed or lost.
From my internal testing on servers this resolves our issues when running multiple iperf instances to simulate stress on the network stack by running multiple network applications.