gpt4 book ai didi

asynchronous - 任务被取消 - 这是什么意思?

转载 作者:行者123 更新时间:2023-12-04 15:08:29 25 4
gpt4 key购买 nike

我正在使用 Azure 搜索 .Net SDK。

我正在调用这样的同步(非异步)函数:

var searchResults = searchIndexClient.Documents.Search<T>(searchText, searchParameters);

它通常有效。我没有使用任何异步函数,但不知何故我刚刚得到的错误看起来像一个异步错误:
System.Threading.Tasks.TaskCanceledException: A task was canceled.

CancellationToken: IsCanceleationRequested=false

Task: Id = 556, Status = Canceled, Method = "{null}", Result = "{Not yet computed}"

StackTrace:

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.Azure.Search.DocumentsOperations.<DoContinueSearchWithHttpMessagesAsync>d__15
3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.Azure.Search.DocumentsOperationsExtensions.<SearchAsync>d__15
1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at Microsoft.Azure.Search.DocumentsOperationsExtensions.Search[T](IDocumentsOperations operations, String searchText, SearchParameters searchParameters, SearchRequestOptions searchRequestOptions)
at MyApp.AzureSearch.AzureSearchService.PerformSearch[T](String searchText, SearchParameters searchParameters) in c:\Projects\MyAppServer\src\MyApp.AzureSearch\AzureSearchService.cs:line 359
at MyApp.AzureSearch.AzureSearchService.Search[T](String searchText, List
1 searchFields, SearchMode searchMode, List1 select, Nullable1 skip, Nullable1 top, String filter, Boolean includeTotalResultCount, List1 orderBy) in c:\Projects\MyAppServer\src\MyApp.AzureSearch\AzureSearchService.cs:line 262 at MyApp.AzureSearch.AzureSearchService.SearchEmails(Guid userId, String origin, String searchText, Nullable1 skip, Nullable1 top, Boolean includeTotalResultCount, Boolean includeHtmlBody, Boolean orderByProcessedAscending, String interactionStatus) in c:\Projects\MyAppServer\src\MyApp.AzureSearch\AzureSearchService.cs:line 167 at MyApp.Domain.MyAppMessages.Command.MyAppMessagesAllNoticedUpdater.Handle(VisitorSession userSession, NoticeAllMyAppMessages processCommand) in c:\Projects\MyAppServer\src\MyApp.Domain\MyAppMessages\Command\MyAppMessagesAllNoticedUpdater.cs:line 30

最佳答案

最有可能的是,在搜索完成之前客户端超时已过期。您在提交特别复杂的查询时是否看到此错误?如果需要,您可以使用 search traffic analytics 查看服务中的搜索性能。 .

您看到“异步”异常的原因是 API 的同步版本只是异步原语的包装器。

关于asynchronous - 任务被取消 - 这是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40459796/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com