-
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
Issue #12272 - Potential deadlock with Vaadin. #12506
Issue #12272 - Potential deadlock with Vaadin. #12506
Conversation
Fixed the case where a GOAWAY followed by a TCP FIN was causing a race between closing the `EndPoint` and running the failure `Runnable` task. The TCP FIN after the GOAWAY causes the streams to be failed on the server; in turn, failing the streams generates failure `Runnable` tasks that are submitted to the HTTP/2 execution strategy; however, the streams were destroyed before the failure `Runnable` tasks actually ran, so the `EndPoint` was closed; closing the `EndPoint` would close the `HTTP2Connection`, which in turn would stop the execution strategy; this lead to the fact that the failure `Runnable` tasks were never run. Now, the failure `Runnable` tasks are invoked via `ThreadPool.executeImmediately()` rather than being submitted to the execution strategy. This ensures that they would be run and not queued, even in case of lack of threads, so that they could unblock blocked reads or writes, freeing up blocked threads. Additionally, improved `HTTP2Stream.onFailure()` to destroy the stream only after the failure tasks have completed. Smaller other fixes to improve the code. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
7b9b156
to
713a308
Compare
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.
Just a couple of nits.
await().atMost(5, TimeUnit.SECONDS).until(() -> !session.getEndPoint().isOpen()); | ||
|
||
// Cleanup. | ||
dataList.forEach(Stream.Data::release); |
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.
The cleanup could be done right after awaiting !dataList.isEmpty()
await().atMost(5, TimeUnit.SECONDS).until(() -> !session.getEndPoint().isOpen()); | ||
|
||
// Cleanup. | ||
dataList.forEach(Stream.Data::release); |
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.
Ditto.
Added test case.