-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
service/dap: limit the number of goroutines returned from threads req #2595
Conversation
…request This adds a cap and a log message if there are many goroutines. This will help prevent the debugger from freezing, but does not yet address making sure the interesting goroutines are the ones that are returned. Updates golang/vscode-go#129
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Btw, is a risk of loosing the current goroutine if we just truncate? |
There is definitely a risk of losing the current goroutine, and I did not attempt to address that in this PR. It's possible to get around this by checking the threads and finding the IDs of the goroutines that are running, and appending them to the end of the list if they are not already included. If we allow users to specify filters on what goroutines they want displayed, we can make it easier for them to only see the goroutines they want to inspect. |
Can't you just rely on debugger state to get current goroutine and make sure it is in the returned list? |
Sure that sounds like it would work. Looking at the threads would allow us to make sure that any running goroutines were included if there was more than one. |
FYI making sure that selected routine is included in the returned list was added in #2683 |
This adds a cap and a log message if there are many goroutines. This will help
prevent the debugger from freezing, but does not yet address making sure the
interesting goroutines are the ones that are returned.
Updates golang/vscode-go#129