-
Notifications
You must be signed in to change notification settings - Fork 175
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
Cohttp expose closefn function #1036
base: v5-backports
Are you sure you want to change the base?
Cohttp expose closefn function #1036
Conversation
@@ -180,6 +180,9 @@ struct | |||
|
|||
let callv ?ctx:_ _uri _reqs = Lwt.fail Cohttp_lwt_xhr_callv_not_implemented | |||
|
|||
let call_with_closefn ?ctx:_ ?headers:_ ?body:_ ?chunked:_ _meth _uri = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we ask for the advice of the maintainers of the library, as we advocate that this function will never be called from this library, but we want to receive a second opinion.
@art-w Do you know how we can move forward on this? |
I believe the cohttp maintainers are looking to publish 6.0 but have very limited time. Would using the v6 address your issue or do you have a use-case that must stick with the v5 and is leaking without this new function? (Note that I agree with the leak analysis and proposed fix! But it's not entirely clear from the report if the PR is a nice-to-have or a must-have, which would provide motivation for maintainers to spend time on a v5 release instead of a v6 release... but I'm not a cohttp maintainer so I can't speak for them!) If you need a new release of v5 with this and #1035 , it would help to fix the CI as it's going to be a blocker for opam. I know the errors were not introduced by your PRs, but I believe it would maximize your chances if you minimize the time spent by maintainers to upstream your work. Good luck! |
4cc3ac3
to
996424f
Compare
Hello! |
I think that you were very close to fixing the CI and that you are the most motivated to see it through! Run I would also open a new PR specifically to fix the v5 CI (an easy merge once green), and rebase your other PRs on top (and then politely ping the maintainers to see if they are interested). |
996424f
to
bb2c302
Compare
8460a03
to
23da4ff
Compare
72ec356
to
1ceb38f
Compare
basically, I cannot reproduce the behaviour from the CI locally. Locally, running make does not get me any error. However, in the current CI, there is an issue (among others), which suggests me using |
If you can't reproduce locally then you don't have the latest dependencies installed. I don't know how a fresh build resulted in a broken opam switch or how to repair it, but I hope you'll find a way to get back to a working environment! In any case, every I vaguely remember the |
I tried reproducing the behaviour from here, but the
|
I guess you need a macos to run this one. The linux images should work though. |
I used that because I have macOS specifically, that is why I am confused. |
Right, my bad, the CI has to use a docker alternative to run natively on macos (but I don't think it's worth the effort to set it up on your system for this PR, as the CI issues are not macos related). Your previous terminal paste mentions On a side note, you have 5 co-authors on your PR. Can they help you out? |
Hey! Sorry for the late reply, I was caught with other projects.. I opened a new PR to fix the CI (#1094), but I have something to ask. Is it required that all the tests work from the "Main workflow"? I tried with |
This work has been done together by the following people:
@savvadia
@vect0r-vicall
@picojulien
@johnyob
@raphael-proust
Motivation
cohttp
is not closing client-side connections on request in relay connections, which could lead to resource leak.Exposing the
close_fn
function is already present in the newerv6
version, so this addition we think is necessary as it allows finer resource management and is likely to be a backport of the feature fromv6
tov5
.Solution
cohttp
now exposesclose_fn
defined byCohttp_lwt.Client.call
. This callback should be used when a newly created connection should be closed, thanks to the newCohttp_lwt.Client.call_with_closefn
function.