-
Notifications
You must be signed in to change notification settings - Fork 87
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
mirage-tcpip
is blocked when we want to make more than 65535 connections
#462
Comments
So it seems that the |
@balrajsingh it seems that with your patch, the "finalizer" of a connection (which A possible solution is to return This is my current patch when my process is killed then: diff --git a/src/tcp/segment.ml b/src/tcp/segment.ml
index 0394c5fa..05197f89 100644
--- a/src/tcp/segment.ml
+++ b/src/tcp/segment.ml
@@ -110,12 +110,17 @@ module Rx(Time:Mirage_time.S) = struct
let check_valid_segment q seg =
if seg.header.rst then
- if Sequence.compare seg.header.sequence (Window.rx_nxt q.wnd) = 0 then
- `Reset
- else if Window.valid q.wnd seg.header.sequence then
- `ChallengeAck
- else
- `Drop
+ begin match State.state q.state with
+ | State.Reset ->
+ `Reset
+ | _ ->
+ if Sequence.compare seg.header.sequence (Window.rx_nxt q.wnd) = 0 then
+ `Reset
+ else if Window.valid q.wnd seg.header.sequence then
+ `ChallengeAck
+ else
+ `Drop
+ end
else if seg.header.syn then
`ChallengeAck
else if Window.valid q.wnd seg.header.sequence then` Again, I don't have any clue about the state machine of the TCP/IP stack but I hope that the description of the bug is clear 👍 . I will try to craft a |
This the zipped file of what is going on when we want to send an email (you can open it with wireshark) to introspect TCP/IP packets. |
We have lot of The I already notice this behavior which comes from the TCP/IP stack of the Linux kernel and I'm not sure how to properly handle that. Finally, this PCAP file use my own version of EDIT: last note, I did not notice a memory leak even with the patch with a restricted usage of it. So it sill is a good news 👍 . |
@dinosaure I think returning I think the fix should be to first clean up the hash tables correctly when the connection ends. The second fix should be to fix |
Yes, but That means that in anyway, we don't properly finalize the connection (and free resources correctly) - even if, in the point of view of the application, the connection is closed. |
@dinosaure can you confirm that entries in the hash tables are not removed up at the end of a connection? The "finalising" process is as follows: the flow when it completes the 3 way handshake and is When instead of the usual Also the stack generating |
@dinosaure I don't immediately see a missing call in
Also let me know some details about your setup: what is the test you are running, which TCPs are involved (mirage, Linux,..) and what is each TCP doing. Thanks. |
This issue is much more easier I think that #456 but on my stress test, it's about:
mirage-tcpip/src/tcp/flow.ml
Lines 633 to 653 in 9676ef3
At one stage, the server just block any concurrent processes. I will try to find a convenient way to fix this issue.
TODO
tells me that such case was never reached before.The text was updated successfully, but these errors were encountered: