-
Hi, we are using YARP to forward requests in our services. We are seeing some "The request was canceled before receiving a response." debug messages in telemetry. However, we noticed when this happened the target is still continuing processing the request even though the client-YARP connection has been closed. I was wondering if YARP closes the YARP-target connection then the client closes its connection? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It'll depend on the type of request, the HTTP version, and when during the request the client disconnected. If the client disconnects while YARP is sending out a request to the backend, YARP will "cancel" that outgoing request. A small exception to that is that if the client disconnects while you're copying back the response, YARP will attempt to keep reading for a short period in hopes that the response is short and that we'll be able to reuse the connection. Are you using |
Beta Was this translation helpful? Give feedback.
It'll depend on the type of request, the HTTP version, and when during the request the client disconnected.
If the client disconnects while YARP is sending out a request to the backend, YARP will "cancel" that outgoing request.
What that means in practice is that we'll close the TCP connection when using HTTP/1.1, or send a reset frame on HTTP/2.
If you're using Kestrel on the backend, both of these would be surfaced to you as
HttpContext.RequestAborted
getting signaled.A small exception to that is that if the client disconnects while you're copying back the response, YARP will attempt to keep reading for a short period in hopes that the response is short and that we'll be able to reuse …