-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RequestContext.CancellationToken is never used #34988
Comments
I found this while changing |
@annelo-msft pointed out that the Line 176 in 49cf1a2
However, if you call Line 250 in 49cf1a2
|
@heaths, given this finding, is there still an issue in CLU? Or only in KeyVault where the pipeline is being called manually? What libraries are actually affected? |
No, it seems there's no issue with CLU. Only when trying to add a convenience method taking a |
Could the extension method be called in the convenience method, or is that not possible? |
Sure it could, but now there's an implicit dependency people just have to know to use or behavior may vary (and it's not like many libraries seem to test cancellation). What's wrong with making sure it's always set in a call that everyone has to use anyway like |
Nothing is wrong with it, and I agree it's a nicer approach. I ask primarily to evaluate whether you're blocked or not, as a means of prioritizing this relative to other tasks. |
For APIs that expose a
RequestContext
instead of aCancellationToken
, users can only pass aCancellationToken
by settingRequestContext.CancellationToken
; however, VS shows 0 references toRequestContext.CancellationToken
and walking through the pipeline code, everything seems to readHttpMessage.CancellationToken
which is only set byHttpPipeline.Send
andSendAsync
- not something most users are really meant to call themselves.Looking at generated client code like
azure-sdk-for-net/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClient.cs
Lines 141 to 157 in 49cf1a2
azure-sdk-for-net/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClient.cs
Lines 248 to 263 in 49cf1a2
RequestContext.CancellationToken
is used; thus, it seems impossible for customers to cancel any methods taking aRequestContext
.The text was updated successfully, but these errors were encountered: