{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-aspnetcore/issues/373","repository_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-aspnetcore","labels_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-aspnetcore/issues/373/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-aspnetcore/issues/373/comments","events_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-aspnetcore/issues/373/events","html_url":"https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/373","id":217941067,"number":373,"title":"Synchronize access to HttpContext","user":{"login":"SergeyKanzhelev","id":9950081,"avatar_url":"https://avatars2.githubusercontent.com/u/9950081?v=4","gravatar_id":"","url":"https://api.github.com/users/SergeyKanzhelev","html_url":"https://github.com/SergeyKanzhelev","followers_url":"https://api.github.com/users/SergeyKanzhelev/followers","following_url":"https://api.github.com/users/SergeyKanzhelev/following{/other_user}","gists_url":"https://api.github.com/users/SergeyKanzhelev/gists{/gist_id}","starred_url":"https://api.github.com/users/SergeyKanzhelev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergeyKanzhelev/subscriptions","organizations_url":"https://api.github.com/users/SergeyKanzhelev/orgs","repos_url":"https://api.github.com/users/SergeyKanzhelev/repos","events_url":"https://api.github.com/users/SergeyKanzhelev/events{/privacy}","received_events_url":"https://api.github.com/users/SergeyKanzhelev/received_events","type":"User","site_admin":false},"labels":[{"id":188625995,"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-aspnetcore/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-aspnetcore/milestones/27","html_url":"https://github.com/Microsoft/ApplicationInsights-aspnetcore/milestone/27","labels_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-aspnetcore/milestones/27/labels","id":2624092,"number":27,"title":"2.1.1","description":"","creator":{"login":"AlexBulankou","id":11968377,"avatar_url":"https://avatars3.githubusercontent.com/u/11968377?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexBulankou","html_url":"https://github.com/AlexBulankou","followers_url":"https://api.github.com/users/AlexBulankou/followers","following_url":"https://api.github.com/users/AlexBulankou/following{/other_user}","gists_url":"https://api.github.com/users/AlexBulankou/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexBulankou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexBulankou/subscriptions","organizations_url":"https://api.github.com/users/AlexBulankou/orgs","repos_url":"https://api.github.com/users/AlexBulankou/repos","events_url":"https://api.github.com/users/AlexBulankou/events{/privacy}","received_events_url":"https://api.github.com/users/AlexBulankou/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":3,"state":"open","created_at":"2017-07-05T22:57:46Z","updated_at":"2017-07-10T23:49:51Z","due_on":"2017-07-12T07:00:00Z","closed_at":null},"comments":20,"created_at":"2017-03-29T16:55:55Z","updated_at":"2017-09-08T12:21:27Z","closed_at":null,"author_association":"MEMBER","body":"`HttpContext` class is not thread safe. So accessing it from telemetry initializers on the different threads have to be synchronized. Today enabling Application Insights on highly async web site with many tasks running in parallel may cause failures or hangs.\r\n\r\n```\r\n000000aa`844d7fe0 00007ffc`97b8d704 mscorlib_ni!System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]].FindEntry(System.__Canon)+0x10c\r\n000000aa`844d8050 00007ffc`39d0cb71 mscorlib_ni!System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]].TryGetValue(System.__Canon, System.__Canon ByRef)+0x14\r\n000000aa`844d8090 00007ffc`39d0cae6 Microsoft_AspNetCore_Http_Features!Microsoft.AspNetCore.Http.Features.FeatureCollection.get_Item(System.Type)+0x41\r\n000000aa`844d80d0 00007ffc`39f1afd2 Microsoft_AspNetCore_Http_Features!Microsoft.AspNetCore.Http.Features.FeatureCollection.Get[[System.__Canon, mscorlib]]()+0x36\r\n000000aa`844d8110 00007ffc`39f1ae38 Microsoft_AspNetCore_Http_Features!Microsoft.AspNetCore.Http.Features.FeatureReferences`1[[System.__Canon, mscorlib]].UpdateCached[[System.__Canon, mscorlib],[System.__Cano\r\nnon>, Int32, Boolean)+0x72\r\n000000aa`844d8180 00007ffc`39f1a3f6 Microsoft_AspNetCore_Http!Microsoft.AspNetCore.Http.Features.RequestCookiesFeature.get_Cookies()+0xc8\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-aspnetcore/issues/comments/328088601","html_url":"https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/373#issuecomment-328088601","issue_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-aspnetcore/issues/373","id":328088601,"user":{"login":"andrasg","id":10730249,"avatar_url":"https://avatars1.githubusercontent.com/u/10730249?v=4","gravatar_id":"","url":"https://api.github.com/users/andrasg","html_url":"https://github.com/andrasg","followers_url":"https://api.github.com/users/andrasg/followers","following_url":"https://api.github.com/users/andrasg/following{/other_user}","gists_url":"https://api.github.com/users/andrasg/gists{/gist_id}","starred_url":"https://api.github.com/users/andrasg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrasg/subscriptions","organizations_url":"https://api.github.com/users/andrasg/orgs","repos_url":"https://api.github.com/users/andrasg/repos","events_url":"https://api.github.com/users/andrasg/events{/privacy}","received_events_url":"https://api.github.com/users/andrasg/received_events","type":"User","site_admin":false},"created_at":"2017-09-08T12:21:26Z","updated_at":"2017-09-08T12:21:26Z","author_association":"NONE","body":"@SergeyKanzhelev, @dnduffy I think the reason why DI was not preferred for storing `RequestTelemetry` is that the request scoped DI container gets destroyed (request ended) before all telemetry information is processed. At least that's what I remember from my experimentations with telemetryinitializers."}}
{"actor":{"display_login":"andrasg"}}