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

Handling long running operation in VisualizerObjectSource #325

Open
Giorgi opened this issue Feb 21, 2024 · 2 comments
Open

Handling long running operation in VisualizerObjectSource #325

Giorgi opened this issue Feb 21, 2024 · 2 comments

Comments

@Giorgi
Copy link

Giorgi commented Feb 21, 2024

In my EFCore.Visualizer project I have a custom VisualizerObjectSource that retrieves query plan. But in some cases, if the query is complex or database connection is slow the time to retrieve the plan exceeds the five seconds timeout that third party visualizers have and users get Evaluation timed out error

I tried to implement a solution according to Work with large and complex objects but in my case I can't break down plan retrieval into smaller actions. Instead, my idea was to start a long running task with Task.Run and call RequestDataAsync until the task is finished. But this approach doesn't work either because when VS is in break mode it doesn't run other threads so I get: StreamJsonRpc.RemoteInvocationException: cannot evaluate expression since the function evaluation requires all threads to run.

Is there any way to tell VS to run my task or is there some other way to execute long running operation without causing timeout from VS?

@mpeyrotc
Copy link
Member

Hello @Giorgi, sadly that is a limitation that the debugger enforces to every evaluation that happens within the debugger. In the case of visualizers, no evaluation can take more than 5 seconds. I will see if there is anything that can be done to make your visualizer work and then get back to you. Thanks!

@Giorgi
Copy link
Author

Giorgi commented Feb 29, 2024

Yes, I understand that there is a 5-second limit for the RequestDataAsync but I could call it in a loop if there was a way to use Task.Run inside debuggee without getting StreamJsonRpc.RemoteInvocationException

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

No branches or pull requests

2 participants