-
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 #9476 - Fix 9.4.51 NullPointerException #9932
Conversation
Added a null check for the Callback parameter in o.e.j.iAbstractConnection.failedCallback(Callback, Throwable) so that the subsequent code-flow is not aborted; while the root cause may be ascertained in case debug logging is enabled. Further, in the case of a RejectedExecutionException when submitting the failCallback, the Runnable is run instead of directly invoking the Callback, so that exceptions in the Callback do not abort the synchronous code-flow.
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 think this is the right solution. It is ignoring a null callback that should never have been created/executed.
Instead, I think the fix should be in onCompleteSuccess
and onCompleteFailure
on org.eclipse.jetty.server.HttpConnection.SendCallback
. Both of these methods should call release()
and if they get null back, then do no more.
I can see other problems there (those methods are not truly atomic), but we are not going to entirely fix jetty-9.4.
…lback 1. Fixed the usages of `Callback` returned by `o.e.j.s.HttpConnection.SendCallback.release()` to check for `null` before invoking the `failedCallback(Callback, Throwable)` or `succeeded()` methods. 2. Also, added a try-finally block around the Callback invocations in order to ensure that shutdownOutput will get performed irrespective of whether they end up throwing any exception.
…w feedback Partially reverted `o.e.j.i.AbstractConnection.failedCallback(Callback, Throwable)` to not have a null check for the `Callback` parameter, based on review feedback from @gregw. This avoids changing the contract of the method parameter (from `@NonNull` to `@Nullable`).
Thank you very much @gregw for the review and comments.
Please re-review this PR. Thank you very much. |
Replaced by #9935 |
#9476
Added a null check for the Callback parameter in o.e.j.iAbstractConnection.failedCallback(Callback, Throwable) so that the subsequent code-flow is not aborted; while the root cause may be ascertained in case debug logging is enabled.
Further, in the case of a RejectedExecutionException when submitting the failCallback, the Runnable is run instead of directly invoking the Callback, so that exceptions in the Callback do not abort the synchronous code-flow.