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

Not sure Hyper.get and Hyper.post are closing the connection #11

Open
craff opened this issue Oct 2, 2024 · 2 comments
Open

Not sure Hyper.get and Hyper.post are closing the connection #11

craff opened this issue Oct 2, 2024 · 2 comments

Comments

@craff
Copy link

craff commented Oct 2, 2024

Hello,

I observed a leak on file descriptors with a software using Hyper. Looking at the code, the body function does not seem to issue a Message.close, nor does the Hyper.get or Hyper.post.

I am investigating more, but put the issue in case you can confirm.

Cheers,
Christophe

@craff
Copy link
Author

craff commented Oct 13, 2024

I investigated more. Calling Message.close and/or using Hyper.request did not solve the problem.
I think it is deeper in Dream and may be related to issue 347 of dream.

The observed behavior is that in general 5-10 unused sockets are preserved for some unknown reasons, but after a few days, this increase to more that 1000 sockets and the program fails with EMFILES as expected.

Switching to http-lwt-client immediatly solved the issue, so it must be an issue related to Hyper/Dream. Now no unused socket is kept.

Now that I have switched my code in production to http-lwt-client, I will not be able to investigate more. Sorry.

@hannesm
Copy link

hannesm commented Oct 14, 2024

Thanks for the endorsement, I'm glad http-lwt-client is useful for you. It was quite some work to get a non-fd-leaking HTTP client (we iterated several times over the codebase to find and fix leaks).

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

No branches or pull requests

2 participants