Skip to content

LanguageServer.Shutdown method hangs indefinitely when flushing buffered output #159

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

Closed
daviwil opened this issue Feb 16, 2016 · 0 comments
Labels
Issue-Bug A bug to squash.
Milestone

Comments

@daviwil
Copy link
Contributor

daviwil commented Feb 16, 2016

The LanguageServer.Shutdown method in the Protocol project hangs indefinitely when there is buffered output to be flushed before shutting down. This is caused by the outputDebouncer.OnFlush().Wait() call which blocks the current SynchronizationContext, preventing the subsequent SendEvent call from completing.

@daviwil daviwil added the Issue-Bug A bug to squash. label Feb 16, 2016
@daviwil daviwil added this to the 0.4.2 milestone Feb 16, 2016
daviwil added a commit that referenced this issue Feb 16, 2016
The change fixes an issue in the LanguageServer's Shutdown method where
buffered output in the OutputDebouncer gets flushed before shutting down.
The problem here is the Wait call which blocks the message dispatcher
thread from completing the OutputDebouncer.OnFlush method's SendEvent
call.  The fix is to change the Shutdown method to async so that the
OnFlush call can be awaited, unblocking the message dispatcher thread's
SynchronizationContext for the SendEvent call to complete.
daviwil added a commit that referenced this issue Feb 16, 2016
Fix #159: LanguageServer.Shutdown hangs on flush
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests

1 participant