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
Upgrade http4s, http4s-servlet #118
Conversation
Fixes cancellation to match CE3.5 semantics
@rossabaker - hopefully this is helpful, it just tweaks #111 to register the listener earlier (otherwise the |
Sorry - looks like there were some overly aggressive import changes which should be fixed now |
Thank you!!! I'll try to run this a few times tonight, since it was an intermittent failure, and I could only manifest it on CI. I think it would be ideal to clean up the listener, but we didn't before and never had a reported leak, and at this point, I just want to get a cats-effect-3.5-compilant release out ASAP. |
Nuts. Still got failures in the 2.13 branches. The Scala 3.2 failure is because we need a Scala 3.3 upgrade. I'll merge that in here. |
Looking at this again, I can't see how the test failures observed here would be caused here (rather than in There are a couple of places where I think this might be creeping in, but I don't understand why this test is passing whilst this is consistently failing. I'll see if I can open a PR there to try and solve those |
Did another dig through - the test failure observed here is consistent with what would happen if the service handler wasn't being effectively canceled (and thus backpressuring) in the race here. |
Yeah, we started pulling in a copy of |
How important is it to set the timeout on the async context here? Trying a bunch of things, it appears replacing that with standard CE I suspect it might have something to do with the Jetty version (since everything seems stable on Jetty 10) - my best guess is it might be to do with this (possibly with this follow-up which appears to only be in Jetty 10) |
Nice sleuthing. In theory, it's better to call the servlet's async handler, because other listeners could be added, perhaps in a filter or an extension to the servlet. In practice, I bet nobody is or ever has. I'll stare at those Jetty diffs a bit, but I think your alternate solution may end up being the winner here. |
On the
|
If we don't do anything with the async context ourselves, we get a default timeout of 30 seconds rather than reading the timeout as we always have. Just because we don't install a listener doesn't mean the clock isn't ticking. To go with the approach in @sgjbryan's commit, which I like, we'd have to set the timeout to 0. f06f455 (when it publishes) attempts to stick to the servlet mechanism for a timeout, but renders the timeout response within the listener. It's not as simple, but might be better integrated with weird servlet shit people might do. |
Builds have passed twice. Restarting now. If they're still green after this comment, I'm ready to declare victory. We'll get one more chance when we un-RC the servlet version. |
Grand, thanks so much for looking into this! http4s/http4s-servlet#221 looks good to me, and running the request completion in the timeout listener seems to be the correct thing to do. |
This is working on the released versions. I'm going to release it. Thanks for your help @sgjbryan! |
Similar to #111, adding the lifecycle listener earlier to avoid hangs in the
lifecycle.isStopping()
branch