#126 - add initialDelay to SSE scheduler to give server's handshake processing time #189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original ticket : #126 . This PR also follow-up for this PR in Kill Bill repository : killbill/killbill#2169
LogsSseHandlerscheduled its drain loop withinitialDelay=0, so the background thread could publish events while the servlet container was still completing the SSE handshake. In that window the channel remains in its blocking phase (asyncStarted could betrue, but the response isn’t committed yet), and the container throw exception (IllegalStateException: api=BLOCKED in Jetty) when we write.Video below shows what exactly happened:
curlcalls to SSE endpointjettyState=HANDLING .... responseCommitted=falsemeaning the server still processing the handshake/request, and response not committed yet.platform-126-SSE-without-initial-delay.webm
To be continued in comment ....