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

Fix application lockups when calling into app insights from Task sche… #76

Closed
wants to merge 1 commit into from

Conversation

mousetraps
Copy link
Contributor

…duled

on UI thread

  • It is currently possible for the long-running InMemoryTransmitter.Runner
    task to be executed (and thereby block during WaitOne) on the UI thread when
    called by a task scheduled on the UI thread. This fix guarantees that
    InMemoryTransmitter.Runner never blocks the main thread by explicitly
    specifying TaskScheduler.Default when calling StartNew.

We recently ran into this issue in Node.js Tools for VS, and managed to work around it by using TaskCreationOptions.HideScheduler, but it would be great to fix it at the source.

And here's a blog post that provides a little more context on the issue:
http://blogs.msdn.com/b/pfxteam/archive/2012/09/22/new-taskcreationoptions-and-taskcontinuationoptions-in-net-4-5.aspx

…duled

on UI thread
- It is currently possible for the long-running InMemoryTransmitter.Runner
  task to be executed (and thereby block during WaitOne) on the UI thread when
  called by a task scheduled on the UI thread. This fix guarantees that
  InMemoryTransmitter.Runner never blocks the main thread by explicitly
  specifying TaskScheduler.Default when calling StartNew.
@SergeyKanzhelev
Copy link
Contributor

cc @JakubOleksy, @mihailsm

Thanks @mousetraps! Can you please re-send this PR for develop branch.

Have you tried PersistenceChannel for nodejstools? You can find info about persistence channel on my blog and on [azure docs(https://azure.microsoft.com/documentation/articles/app-insights-windows-desktop/#persistence-channel). I see calls to StartNew there, but it looks like all of them are not called directly from UI thread.

@mousetraps
Copy link
Contributor Author

Just re-sent for develop branch. In this case, it wasn't actually stemming from our app insights calls, but rather from one in a VS SCC component that we have no control over. We are indeed using PersistenceChannel for NTVS.

@mousetraps mousetraps closed this Oct 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants