You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Even if it waits for the visualizer command to exit, the problem still
exists because some visualizer exits before the UI is closed (e.g. chrome
when a chrome window is already open.)
I noticed that there is already a 1 second wait in the logic I pointed to. I must have been really unlucky and Chrome somehow took longer than 1 second to load up. I'm not sure if there's anything we could do here then. Increasing the wait time seems like a bad idea (how high is high enough?).
Note the logic is to do wait for the visualizer in non-interactive mode. On interactive mode (pprof shell) we do not wait to allow you to let you go back to the command line and spawn other visualizers in parallel.
Having said that, there is a fundamental race condition: we to write the files, run the viewer, wait for the viewer read the files, and then delete them. The problem happens when the visualizer is a command that signals another command (eg chrome), so the visualizer exits even though the files haven't been read.
I could agree with special-casing the delay for some platforms.
In
invokeVisualizer
, we defer deleting the temporary file when invoking the visualizer until the end of thepprof
program. However, theinvokeVisualizer
does not wait for the viewer to finish when not running in interactive mode.Thus, the following race occurs in non-interactive mode:
pprof
generates some reportpprof
invokes the browser to show report; Chrome starts runninginvokeVisualizer
and thepprof
program begins terminations.DeferDelete
is run, deleting the report fileThe fix is probably to wait for the visualizer to end regardless of "interactivity".
The text was updated successfully, but these errors were encountered: