-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fixes HttpClient Content.Source reads from arbitrary threads #12203
Fixes HttpClient Content.Source reads from arbitrary threads #12203
Conversation
* Introduced a boolean parameter to parseAndFill() and parse(), that specifies whether to notify the application demand callback. This is necessary because reads may happen from any threads, and must not notify the application demand callback. Only when there is no data, and fill interest is set, then the application demand callback must be notified. * Removed action field to avoid lambda allocation. * Now the application is called directly from the parse() method. * Reading -1 from the network drives the parser by calling again parse(), rather than the parser directly. This allows to have a central place to notify the response success event. Signed-off-by: Simone Bordet <[email protected]>
…response. Signed-off-by: Simone Bordet <[email protected]>
…ntent. This avoids the rare case where the response arrives before the request thread has modified the request state, even if the request has been fully sent over the network, causing the request to be failed even if it should not. Signed-off-by: Simone Bordet <[email protected]>
Is that an alternative for the fix in #12143? |
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.
I don't mind this change, as long as the SerializedInvoker
assertions added in #12143 don't trip. So I think they should be added as part of this PR too.
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.
This is much cleaner than #12143. After modifying FCGI too, I can't insist enough that the SerializedInvoker
assertions should be added too.
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.
This class should have the SerializedInvoker
assertions of #12143
Signed-off-by: Simone Bordet <[email protected]>
Signed-off-by: Simone Bordet <[email protected]>
Signed-off-by: Ludovic Orban <[email protected]>
Signed-off-by: Ludovic Orban <[email protected]>
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/thread/SerializedInvoker.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/thread/SerializedInvoker.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/thread/SerializedInvoker.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/thread/SerializedInvoker.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ludovic Orban <[email protected]>
@sbordet nudge |
No description provided.