Skip to content
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

The GUN instance still exist after the socket was closed by OS(in the case of IP path failure). #227

Closed
rody-liu opened this issue Apr 21, 2020 · 1 comment

Comments

@rody-liu
Copy link

We open a GUN instance successfully with the following TCP options {send_timeout, 30000} and {send_timeout_close, true}.
The options makes if the TCP stack can’t receive the sending packet and return a timeout, the socket will be closed.
Once the IP path has problem on the TCP connections, and the upper application sends the http request to the GUN instance continuously, the socket will closed finally.
It may be caused by the TCP sending window/buffer full. Then the OS close the socket will and send the TCP RST to peer(although it is impossible received by peer host).
However, the GUN instance is insensitive with this event. In the function gun_http2:request(), the returned value was not checked for gen_tcp:send().
The return value should be {error,timeout} first and {error,enotconn} after the socket is closed. I think GUN instance should exit for reason {error,enotconn} anyway.

bjosv added a commit to Nordix/gun that referenced this issue Sep 16, 2020
To get faster reaction times on failing socket-send of echos/requests
we now handle the response from the send call where applicable.

To avoid a larger change in the statemachine a send error triggers an
event and is handled like an remote socket error/close.

Fixes ninenines#227 and touches ninenines#224
bjosv added a commit to Nordix/gun that referenced this issue Sep 17, 2020
To get faster reaction times on failing socket-send of echos/requests
we now handle the response from the send call where applicable.

To avoid a larger change in the statemachine a send error triggers an
event and is handled like an remote socket error/close.

Fixes ninenines#227 and touches ninenines#224
bjosv added a commit to Nordix/gun that referenced this issue Oct 7, 2020
To get faster reaction times on failing socket-send of echos/requests
we now handle the response from the send call where applicable.

To avoid a larger change in the statemachine a send error triggers an
event and is handled like an remote socket error/close.

Fixes ninenines#227 and touches ninenines#224
@essen
Copy link
Member

essen commented Mar 3, 2022

Closing in favor of #243.

@essen essen closed this as completed Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants