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
Wrong documentation or behavior of Content.copy method #11720
Comments
In this case, I think it is the documentation that is wrong. When reading from source, the reader is free to decide to ignore transient failures and keep trying. The places we do handle transient failures, we don't ignore them. We might avoid closing a connection and then throw to the application/handler/servlet and let it continue its handling, but only to produce an error page. In this case, perhaps we could have a different copy method that takes in a |
@gregw no, I don't have such use case. I'm a freshman in Jetty and just carefully read entire documentation and noticed that. But honestly I didn't know that transient errors could be repeated infinitely and they don't have any limit configuration inside jetty selector |
@gregw thanks a lot! Looks really good |
Jetty version(s)
12.0.8
Description
According to the documentation https://github.com/jetty/jetty.project/blob/jetty-12.0.x/jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/Content.java#L62
In case of failure chunks, the content source is failed if the failure chunk is last, else the failing is transient and is ignored.
But if we look at the implementation it will close Content.Source when any failed Chunk were consumed https://github.com/jetty/jetty.project/blob/jetty-12.0.x/jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/internal/ContentCopier.java#L63
It should be like this to follow the documentation
Note: I think it also make sense to update an example for Copy implementation here https://eclipse.dev/jetty/documentation/jetty-12/programming-guide/index.html#pg-arch-io-content-sink, because it even does not close the Content.Source at all, that may lead to the leaking resources.
The text was updated successfully, but these errors were encountered: