You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases, graceful shutdown by the virtual client socket will abort sending data back to the real client, which causes incomplete TCP exchanges with the real client. It only seems to happen on random occasions and with large HTTP requests; but I will need to investigate some more.
The text was updated successfully, but these errors were encountered:
aramperes
changed the title
Graceful shutdown of virtual client socket doesn't flush remaing packets to real client
Graceful shutdown of virtual client doesn't flush remaing packets to real client
Oct 17, 2021
So this seems to be because I'm running onetun behind ingress-nginx, which keeps a persistent connection to onetun.
After an HTTP request completes:
The peer closes the connection (FIN)
The virtual client's state changes to ESTABLISHED->CLOSE-WAIT
The virtual interface ACKs the FIN
... but the virtual interface and client connection stay alive. On subsequent requests from ingress-nginx, onetun reuses the same virtual interface without reopening the connection and sends the data without doing the handshake. The peer then returns RST.
Handling the CLOSE-WAIT state by closing the connection once the client is done sending data seems like a good fix. The only potential improvement would be to send FIN instead of RST in those cases.
In some cases, graceful shutdown by the virtual client socket will abort sending data back to the real client, which causes incomplete TCP exchanges with the real client. It only seems to happen on random occasions and with large HTTP requests; but I will need to investigate some more.
The text was updated successfully, but these errors were encountered: