Skip to content

Don't close the connection on a receive timeout#486

Open
keathley wants to merge 1 commit intoelixir-mint:mainfrom
keathley:dont-close-socket-on-recv-timeout
Open

Don't close the connection on a receive timeout#486
keathley wants to merge 1 commit intoelixir-mint:mainfrom
keathley:dont-close-socket-on-recv-timeout

Conversation

@keathley
Copy link
Copy Markdown

@keathley keathley commented May 4, 2026

Its often useful to be able to test that a connection has no data waiting on it like recv(socket, 0, 0). This PR handles the timeout error and returns it to the caller, rather than defaulting to closing the connection.

@ericmj
Copy link
Copy Markdown
Member

ericmj commented May 4, 2026

CI found a failing test for this.

Is it clear from the API when Mint closes a connection on errors and when it doesn't or should we document this?

@whatyouhide
Copy link
Copy Markdown
Contributor

To Eric's comment I think yes we should. I feel it would be pretty confusing to not know that, and while I think not closing on timeouts is reasonable I also want to make sure we loudly document that.

@keathley
Copy link
Copy Markdown
Author

keathley commented May 6, 2026

@whatyouhide That makes sense to me. I should have time to fix tests and update docs later today.

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 this pull request may close these issues.

3 participants