Skip to content
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

在使用 await Task.WhenAll 发起http请求时,偶尔抛出 No active span 异常 #102

Closed
ljseer opened this issue Oct 30, 2018 · 2 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@ljseer
Copy link

ljseer commented Oct 30, 2018

在使用 await Task.WhenAll 发起http请求时,偶尔抛出 No active span 异常。


具体异常信息如下:

InvalidOperationException: No active span.
SkyWalking.Context.TracingContext.InternalActiveSpan()
SkyWalking.Diagnostics.HttpClient.HttpClientTracingDiagnosticProcessor.HttpResponse(HttpResponseMessage response)

Show raw exception details
System.InvalidOperationException: No active span.
at SkyWalking.Context.TracingContext.InternalActiveSpan()
at SkyWalking.Diagnostics.HttpClient.HttpClientTracingDiagnosticProcessor.HttpResponse(HttpResponseMessage response)
TargetInvocationException: Exception has been thrown by the target of an invocation.
System.RuntimeMethodHandle.InvokeMethod(object target, object[] arguments, Signature sig, bool constructor, bool wrapExceptions)
System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
SkyWalking.Diagnostics.TracingDiagnosticMethod.Invoke(string diagnosticName, object value)
SkyWalking.Diagnostics.TracingDiagnosticObserver.OnNext(KeyValuePair<string, object> value)
System.Diagnostics.DiagnosticListener.Write(string name, object value)
System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task sendTask, HttpRequestMessage request, CancellationTokenSource cts, bool disposeCts)
SyncSoft.App.Http.HttpClientBase.SendAsync(HttpRequestMessage requestMessage) in HttpClientBase.cs
SyncSoft.App.Http.HttpClientBase.SendAsync(HttpAuthorization authorization, HttpMethod httpMethod, Uri uri, object data) in HttpClientBase.cs
SyncSoft.App.Http.HttpClientBase.PostAsync(HttpAuthorization authorization, Uri uri, object data) in HttpClientBase.cs
SyncSoft.App.WebApi.DefaultApiClient.PostAsync(BearerAuthModeEnum authMode, Uri uri, object data) in DefaultApiClient.cs
SyncSoft.App.WebApi.Proxies.ApiProxyBase.PostAsync(BearerAuthModeEnum authMode, string relativeUri, object data) in ApiProxyBase.cs
SyncSoft.LIVNCo.Web.Areas.Product.Models.Family.FamilyDetailModel.SearchFamilyDetailAsync() in FamilyDetailModel.cs
+
await Task.WhenAll(getProductFamily, getSimpleFamily, getBreadcrumbs).ConfigureAwait(false);
SyncSoft.LIVNCo.Web.Areas.Product.Controllers.FamilyController.Detail(FamilyDetailModel model) in FamilyController.cs
+
await model.SearchFamilyDetailAsync();
Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor+TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments)
System.Threading.Tasks.ValueTask.get_Result()
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
SyncSoft.ECP.AspNetCore.Middlewares.RouteDataMiddleware.Invoke(HttpContext httpContext) in RouteDataMiddleware.cs
SyncSoft.ECP.AspNetCore.Middlewares.ObjectContainerScopeMiddleware.Invoke(HttpContext context) in ObjectContainerScopeMiddleware.cs
SyncSoft.ECP.AspNetCore.Middlewares.RouteDataMiddleware.Invoke(HttpContext httpContext) in RouteDataMiddleware.cs
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
SyncSoft.ECP.AspNetCore.Middlewares.UnauthorizedAjaxHandleMiddleware.Invoke(HttpContext httpContext) in UnauthorizedAjaxHandleMiddleware.cs
SyncSoft.ECP.AspNetCore.Middlewares.AuthEndpointsMiddleware.Invoke(HttpContext httpContext) in AuthEndpointsMiddleware.cs
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

@ljseer ljseer changed the title 使用 await Task.WhenAll 偶尔抛出 No active span 异常 在使用 await Task.WhenAll 发起http请求时,偶尔抛出 No active span 异常 Oct 30, 2018
@liuhaoyang
Copy link
Collaborator

The current tracingContext model does not support concurrent operations.

@liuhaoyang liuhaoyang added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed labels Oct 30, 2018
@shuxinqin
Copy link

shuxinqin commented Dec 25, 2018

他这个问题应该是和这个( #72 ) 一样的原因所致。大佬,抽空修修呗。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants