{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/9963","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/9963/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/9963/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/9963/events","html_url":"https://github.com/dotnet/roslyn/pull/9963","id":142711562,"number":9963,"title":"Guard against EventListener dispose race","user":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-22T16:56:24Z","updated_at":"2016-03-22T16:56:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/9963","html_url":"https://github.com/dotnet/roslyn/pull/9963","diff_url":"https://github.com/dotnet/roslyn/pull/9963.diff","patch_url":"https://github.com/dotnet/roslyn/pull/9963.patch"},"body":"The underlying issue here is EventListener.DisposeOnShutdown has a race\r\ncondition if a new EventSource is added during an AppDomain or Process\r\nexit.  When this occurs there is an unhandled exception during shutdown\r\ndue to a modified collection during enumeration that causes xunit to\r\nfalsely fail the run.\r\n\r\nThe type CDSCollectionETWBCLProvider triggers this bug in our tests.  It\r\nis an EventSource for concurrent collections that is loaded on many\r\nconcurrent collection operations.  These operations are not triggered\r\ndirectly in some of our tests and hence lead to the race.\r\n\r\nThis test guards against them force loading, albeit indirectly, the EventSource\r\ninstance of CDSCollectionETWBCLProvider.  Hence uses during shutdown\r\nare just re-using this instance and don't trigger the race.\r\n\r\ncloses #8936"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/199904758","html_url":"https://github.com/dotnet/roslyn/pull/9963#issuecomment-199904758","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/9963","id":199904758,"user":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T16:56:35Z","updated_at":"2016-03-22T16:56:35Z","body":"CC @davkean, @dotnet/roslyn-interactive "}}