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

ContextManager.ActiveSpan is null in ApplicationOnEndRequest #131

Closed
1 of 4 tasks
DevinShaw opened this issue Jan 16, 2019 · 2 comments
Closed
1 of 4 tasks

ContextManager.ActiveSpan is null in ApplicationOnEndRequest #131

DevinShaw opened this issue Jan 16, 2019 · 2 comments
Labels
duplicate This issue or pull request already exists question Further information is requested
Milestone

Comments

@DevinShaw
Copy link

DevinShaw commented Jan 16, 2019

Please answer these questions before submitting your issue.

  • Why do you submit this issue?
  • Question or discussion
  • Bug
  • Requirement
  • Feature or performance improvement

Bug

  • Which version of SkyWalking, OS and .NET Runtime?
    SkyWalking: 0.7.0
    OS: win7
    .NET Runtime: 4.6.1

  • Which project?
    SkyWalking.Sample.AspNet

  • What happen?
    When I add async action to ValuesController in SkyWalking.Sample.AspNet, I find that ContextManager.ActiveSpan is always null.

    public void ApplicationOnEndRequest(object sender, EventArgs e)
    {
        var httpApplication = sender as HttpApplication;
        var httpContext = httpApplication.Context;
        if (httpContext.Request.HttpMethod == "OPTIONS")
        {
            //asp.net Exclude OPTIONS request
            return;
        }
        var httpRequestSpan = ContextManager.ActiveSpan ;
        if (httpRequestSpan == null)
        {
            return;
        }
    }

@liuhaoyang
Copy link
Collaborator

This is due to the AsyncLocal cross-threading bug in the .NET Framework.

@liuhaoyang liuhaoyang added this to the 0.8.0 milestone Jan 21, 2019
@liuhaoyang liuhaoyang added the question Further information is requested label Jan 21, 2019
@liuhaoyang liuhaoyang added the duplicate This issue or pull request already exists label Feb 5, 2019
@liuhaoyang
Copy link
Collaborator

Repeat with #102, this bug will be fixed in V0.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants