Could someone point me to a resource that would help explain how web api (specifically using Owin Self Host
) handles request cancellation?
Here's the sequence of events i'm observing:
- someone makes a
GET
from chrome - Api controller (through some layers) fires off an async SQL query
- someone hits the X button in chrome (i don't know exactly what happens on socket for this)
What happens next in Web Api??
There was some code running in a controller, does the thread running it get aborted? If it was an async controller awaiting another Task, does that task still have an awaiter in case it returns with an exception?
For context: I do have an async
controller awaiting a Task (this is the only call site) which looks to be throwing an unobserved exception in some edge cases. I haven't been able to isolate or re-produce yet :)
I did find something called HttpResponse.ClientDisconnectedToken
, but don't know well that is supported in Owin Selfhost
+ is it even the good thing to use for all user cancels.