-
Notifications
You must be signed in to change notification settings - Fork 357
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
Deadlock when trying to enable data streaming #5117
Comments
Hi @daijithegeek
No
and it works fine no deadlock. Is it possible that your deadlock relates to the JSON? |
Hi, Thank your for trying this. I'll try to clarify the problem I'm investigating. Yes, the JSON deadlock is what I wanted to show. The problem arises when a The conditions to be met are the following:
The jetty thread is accountable for filling the entity stream is also the one that is blocked, awaiting the entity stream to be filled. As an user the two choices are the following:
PR implementation
I tried with |
I wonder what is your message body reader. When I try your example, I get
|
Thanks a lot for your patience... I didn't realized the test involving JSON serialization was not ok with the current connector implementation. |
Hello,
I'm trying to use the Jersey streaming abilities by leveraging a
StreamingOutput
within a response.The goal is to transfer a large file to a client leveraging the existing stack.
I spotted the two following issues while trying to do so:
readTimeout
configuration is misleading. The PR Change JettyConnector 'readTimeout' behavior to match socket read tim… #5114 should fix the problem.async()
to consume the streamed data, the Jetty connector buffers every byte in-memory before calling back the Jersey stack.I need your opinion, especially on the second matter.
I tried to move the callback, and future completion right after the headers are received; that should work in theory, as all the necessary information is available at that point.
It worked well until I spotted an unexpected deadlock while using a regular endpoint (not streaming data) returning a JSON payload.
I provided an example of my use cases in the following PR: #5116
The test class contains both a streaming example and the deadlock example.
I believe that both use cases are valid. Can you help me to sort out this situation?
I was not able to find an escape hatch by myself, unfortunately.
Thanks a lot for your help!
David
The text was updated successfully, but these errors were encountered: