-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
No TCP backpressure relief on Linux? #1539
Comments
It shouldn't unthrottle until it empties it's buffer. If you continue to send data while its being throttled, ti will continue to report that its throttled. There's nothing in the current code to prevent you from continuing to send data to a TCPConnection that is being throttled. I suspect that is what you are doing. Throttling on writes requires you do communicate back to senders that throttling is occurring and have them pause. |
Yes I realize that, and I do stop sending when I get the 'throttled' notification. But the trouble is that I never get the 'unthrottled' notification when it does empty the buffer. Well, I assume it empties the buffer; the I put in more Debug calls in |
So Epoll doesn't send another writeable event after throttling until disconnect? If you don't get a writeable event then you aren't going to send more data and its not going to ever be unthrottled. Can you verify that when you get throttled, that the write event is resubscribed? It's possible there is a race condition with one shot, we've made additional changes to one shot handling at Sendence to address possible race conditions. We haven't yet submitted them back upstream yet as they are still undergoing testing. Can you clarify what "buffer" you are referring to in: "But the trouble is that I never get the 'unthrottled' notification when it does empty the buffer" |
I have tracing on the event arrivals, and I do not see a 'wriateable' showing up. I will put tracing in on the re-subscription calls too. The "buffer" I was referring to there is the The symptom on the receiving side is that some of the data arrives, then it hangs. The data is a PNG file of about 64KB. I send it 15KB at a time. |
When the connection first comes in there is a resub call with flags=0x0101 ( Then when I break the connection, and it is processing that event, it does some more resubs but by then it is too late. |
The threshold on Linux is 0. Once the buffer is cleared. Windows is different. You appear to be mixing Linux and Windows code together in your analysis. That said, I have figured out where the bug is. We have several improvements to one shot handling that should be landing soon that would make that change not needed. |
Yes, I was looking at the wrong place - Windows and Linux use different unthrottle thresholds. But since the events were not arriving in the first place, it doesn't matter. |
In addition to fixing this bug with the added call to |
you would need to force a throttling scenario which is already quite hard to do. its going to be an unreliable test. very unreliable. |
The complication is that a TCP connection with both ends on the same machine is so fast that throttling hardly ever happens. I test across multiple machines of varying speed, over a wifi link, which is how I found this. |
My program gets 'throttled' by TCP, but never 'unthrottled'. In
tcp_connection.pony
there is a function_pending_writes
that is the only place the_release_backpressure
function gets called.unthrottled
notification is only called from_release_backpressure
_release_backpressure
is only called form two places, lines 501 and 529. Line 501 is inside anifdef windows
so will never be called. Line 529 is inside_pending_writes
.pending_writes
, at lines 373 and 393. Line 373 is inside anot connected
test and would seem not applicable. That leaves line 393.I put in some
Debug.out
calls at line 393 (just as the event is decided to be 'ours') and inside_pending_writes
. Neither one is called, so my program never gets theunthrottled
notifcation, until I abort the transfer from the other end. The program at the other end iswget
.I am trying to track down if this changed recently.
The text was updated successfully, but these errors were encountered: