AddStandardResilienceHandler: snapshot the http request message? #4965
Unanswered
tore-hammervoll
asked this question in
Q&A
Replies: 1 comment
-
@dotnet/dotnet-r9-resilience could you help please? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Looking through the implementation of
AddStandardHedgingHandler()
I see that it adds snapshotting logic to the resilience handler, to ensure each hedged attempt operate on a separate copied instance of theHttpRequestMessage
. I can see how this is necessary to allow each hedged attempt to use a different request URI.The
AddStandardResilienceHandler()
does not have the same snapshotting logic, which I assume is because it is not needed.A side effect of this is that any delegating handler later in the chain will receive a unique instance of the
HttpRequestMessage
for each hedged attempt, while with the standard resilience handler they will receive the same instance again for each retry attempt.With the standard resilience handler this can cause issues if a later delegating handler is not written to handle processing the same
HttpRequestMessage
more than once.Is there an expectation that a delegating handler should be able to process the same
HttpRequestMessage
more than once? If not, should the standard resilience handler be updated to also include similar snapshotting logic as the standard hedging handler?Some context:
The retry logic of the standard resilience handler is causing issues with a delegating handler we use that adds a signature header to the request. The signature is added twice, and causes the request to fail. I could move the the signature handler before the resilience handler as workaround, but that would cause the signature to be reused triggering request replay detection.
Beta Was this translation helpful? Give feedback.
All reactions