htc #20388 HttpServerBluePrint is now resilient to the response being handled before the scheduled timeout response for same exchange. (#20458)
This commit is contained in:
parent
f851bfbad6
commit
92a08ab1d0
1 changed files with 4 additions and 2 deletions
|
|
@ -276,9 +276,11 @@ private[http] object HttpServerBluePrint {
|
|||
override def onUpstreamFinish() = complete(requestOut)
|
||||
override def onUpstreamFailure(ex: Throwable) = fail(requestOut, ex)
|
||||
def emitTimeoutResponse(response: (TimeoutAccess, HttpResponse)) =
|
||||
if (openTimeouts.head eq response._1) {
|
||||
// the application response might has already arrived after we scheduled the timeout response (which is close but ok)
|
||||
// or current head (same reason) is not for response the timeout has been scheduled for
|
||||
if (openTimeouts.headOption.exists(_ eq response._1)) {
|
||||
emit(responseOut, response._2, () ⇒ completeStage())
|
||||
} // else the application response arrived after we scheduled the timeout response, which is close but ok
|
||||
}
|
||||
})
|
||||
// TODO: provide and use default impl for simply connecting an input and an output port as we do here
|
||||
setHandler(requestOut, new OutHandler {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue