Skip to content

Fix threads not fetched after restarting debug adapter - #88790

Merged
Isidor Nikolic (isidorn) merged 1 commit into
microsoft:masterfrom
dlech:fix-fetch-threads-after-restart
Jan 17, 2020
Merged

Isidor Nikolic (isidorn) merged 1 commit into
microsoft:masterfrom
dlech:fix-fetch-threads-after-restart

Conversation

@dlech

Copy link
Copy Markdown
Contributor

A RunOnceScheduler (this.fetchThreadsScheduler) is used to throttle
fetching threads from debug adapters. this.fetchThreadsScheduler is
disposed when a debug adapter is restarted because of:

this.rawListeners.push(this.fetchThreadsScheduler);

This causes threads to never be fetched after restarting the debug
adapter.

This is fixed by setting this.fetchThreadsScheduler to undefined after
it is disposed. This way, a new RunOnceScheduler is created after
restarting the debug adapter.

Fixes #88784

This PR fixes #

A RunOnceScheduler (this.fetchThreadsScheduler) is used to throttle
fetching threads from debug adapters. this.fetchThreadsScheduler is
disposed when a debug adapter is restarted because of:

    this.rawListeners.push(this.fetchThreadsScheduler);

This causes threads to never be fetched after restarting the debug
adapter.

This is fixed by setting this.fetchThreadsScheduler to undefined after
it is disposed. This way, a new RunOnceScheduler is created after
restarting the debug adapter.

Fixes microsoft#88784
@dlech

Copy link
Copy Markdown
Contributor Author

Hmm... CI errors seem unrelated to this PR.

@dlech

Copy link
Copy Markdown
Contributor Author

It turns out this was caused as a side-effect of not using language server protocol correctly, not sure if it is a "real" bug or not.

@dlech

David Lechner (dlech) commented Jan 16, 2020 •

Copy link
Copy Markdown
Contributor Author

The specification says "A debug adapter is expected to send this event when it is ready to accept configuration requests (but not before the ‘initialize’ request has finished)."

So either the specification needs to say "required" instead of "expected" or there is a bug in VS Code.

@isidorn

Copy link
Copy Markdown

This fix is good, thanks for providing it. Merging in this PR.

@isidorn
Isidor Nikolic (isidorn) merged commit 19935de into microsoft:master Jan 17, 2020
@isidorn Isidor Nikolic (isidorn) added this to the January 2020 milestone Jan 17, 2020
@isidorn Isidor Nikolic (isidorn) added the debug Debug viewlet, configurations, breakpoints, adapter issues label Jan 17, 2020
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

debug Debug viewlet, configurations, breakpoints, adapter issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Threads are not fetched after restarting debug adapter

2 participants