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

service/dap: limit the number of goroutines returned from threads req #2595

Merged
merged 1 commit into from
Jul 21, 2021

Conversation

suzmue
Copy link
Contributor

@suzmue suzmue commented Jul 16, 2021

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

…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
Copy link
Member

@derekparker derekparker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@derekparker derekparker merged commit 3941af1 into go-delve:master Jul 21, 2021
Copy link
Collaborator

@polinasok polinasok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@suzmue suzmue deleted the glimit branch July 22, 2021 16:44
@polinasok
Copy link
Collaborator

Btw, is a risk of loosing the current goroutine if we just truncate? Goroutines does enforce that the current goroutine is first, does it?

@suzmue
Copy link
Contributor Author

suzmue commented Jul 22, 2021

Btw, is a risk of loosing the current goroutine if we just truncate? Goroutines does enforce that the current goroutine is first, does it?

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.

@polinasok
Copy link
Collaborator

Can't you just rely on debugger state to get current goroutine and make sure it is in the returned list?

@suzmue
Copy link
Contributor Author

suzmue commented Jul 22, 2021

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.

@polinasok
Copy link
Collaborator

FYI making sure that selected routine is included in the returned list was added in #2683

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.

4 participants