The task has been canceled - what does it mean?

I am using the Azure Search.Net SDK.

I call the synchronous (NOT ASYNC) function as follows:

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

This usually works. I do not use any async functions, but somehow the error I just received looks like an asynchronous error:

 System.Threading.Tasks.TaskCanceledException: A task was canceled. CancellationToken: IsCanceleationRequested=false Task: Id = 556, Status = Canceled, Method = "{null}", Result = "{Not yet computed}" StackTrace: 

in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task) in System.Runtime.CompilerServices.ConfiguredaskTaetwa 1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.Search.DocumentsOperations.<DoContinueSearchWithHttpMessagesAsync>d__15 3.MoveNext () --- The end of the stack trace from the previous location where the exception was thrown --- in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () in System.Runtime.CompilerServices.TccessForwaiter (task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task) in System.Runtime.CompilerServices.ConfiguredTaskAwaitable 1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.Search.DocumentsOperationsExtensions.<SearchAsync>d__15 1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.Search.DocumentsOperationsExtensions.<SearchAsync>d__15 1.MoveNext () --- The end of the stack trace from the previous place where the exception was thrown --- in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (task task ) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task) in System.Runtime.CompilerServices.TaskAwaiter 1.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, SearchM ode searchMode, List 1 select, Nullable 1 skip, Nullable 1 top, String filter, Boolean includeTotalResultCount, List 1 orderBy) in c: \ Projects \ MyAppServer \ src \ MyApp.AzureSearch \ AzureSearchService.cs: line 262 in MyApp.AzureSearch. AzureSearchService.SearchEmails (Guid userId, String origin, String searchText, Nullable 1 skip, Nullable 1 top, Boolean includeTotalResultCount, Boolean includeHtmlBody, Boolean orderByProcessedAscending, String interactiveStatus) in c: \ Projects \ MyAppServer.Server : line 167 on MyApp.Domain.MyAppMessages.Command.MyAppMessagesAllNoticedUpdater.Handle (VisitorSession userSession, NoticeAllMyAppMessages processCommand) in c: \ Projects \ MyAppServer \ src \ MyApp.Domain \ MyAppm

+5
source share
1 answer

Most likely, the client timed out before the search was completed. Do you see this error when sending a particularly complex request? If necessary, you can see the effectiveness of the search in your service using search traffic analysis .

The reason you see the β€œasynchronous” exception is because the synchronous version of the API is just a wrapper over asynchronous primitives.

+3
source

Source: https://habr.com/ru/post/1259389/


All Articles