New issue
Advanced search Search tips

Issue 706916 link

Starred by 5 users

Issue metadata

Status: Archived
Owner:
Closed: Dec 4
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

DevTools: improve the "waiting for debugger to disconnect" UX

Project Member Reported by paulir...@chromium.org, Mar 30 2017

Issue description

With the new about:inspect workflow for nodejs debugging, you sometimes get into a scenario where you really want your node process to exit, but its waiting for the debugger to disconnect.

Meanwhile, you also want the devtools window to stay open for next time, so closing that isn't an option.

Perhaps the solution is a disconnect option inside of devtools?
Not sure.


Anecdotally, there is a lot of adoption of https://github.com/jaridmargolin/inspect-process which does offer an alternative UX which is pretty nice, sa well.
 
Summary: DevTools: improve the "waiting for debugger to disconnect" UX (was: DevTools: "waiting for debugger to disconnect" UX is frustrating)
Connection setup screenshot attached.
node-connect.png
66.8 KB View Download
This is just providing a devtools config UI equivalent of the "network targets" config in chrome://inspect?

wdyt about a button next to Inspect Element to pop open the dedicated window?
I'll look into a button later.

New screenshot with "Connection" panel.
node-panel.png
53.9 KB View Download
Project Member

Comment 5 by bugdroid1@chromium.org, May 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/97e8089cd3fde75e259620213a1e02a1d4f29b35

commit 97e8089cd3fde75e259620213a1e02a1d4f29b35
Author: dgozman <dgozman@chromium.org>
Date: Tue May 09 18:02:05 2017

[DevTools] Expose TCP targets config in frontend, use it for Node

This patch:
- plumbs tcp targets config (shown in inspect ui) to frontend;
- renders that next to port forwarding config;
- reuses that config to discover node instances in node frontend;
- adds "Connection" panel to node frontend.

BUG= 706916 

Review-Url: https://codereview.chromium.org/2864263002
Cr-Commit-Position: refs/heads/master@{#470379}

[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/chrome/browser/devtools/devtools_embedder_message_dispatcher.h
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/chrome/browser/devtools/devtools_ui_bindings.cc
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/chrome/browser/devtools/devtools_ui_bindings.h
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/third_party/WebKit/Source/devtools/front_end/devices/DevicesView.js
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/third_party/WebKit/Source/devtools/front_end/devices/devicesView.css
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/third_party/WebKit/Source/devtools/front_end/devices/module.json
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/third_party/WebKit/Source/devtools/front_end/devtools_compatibility.js
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/third_party/WebKit/Source/devtools/front_end/emulation/module.json
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/third_party/WebKit/Source/devtools/front_end/externs.js
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHost.js
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/third_party/WebKit/Source/devtools/front_end/host/InspectorFrontendHostAPI.js
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/third_party/WebKit/Source/devtools/front_end/inspector.json
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/third_party/WebKit/Source/devtools/front_end/main/module.json
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/third_party/WebKit/Source/devtools/front_end/ui/ListWidget.js
[modify] https://crrev.com/97e8089cd3fde75e259620213a1e02a1d4f29b35/third_party/WebKit/Source/devtools/front_end/ui/listWidget.css

Project Member

Comment 6 by bugdroid1@chromium.org, May 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ad3ffab411cc396ffb20c1d35dcff6de038f14b4

commit ad3ffab411cc396ffb20c1d35dcff6de038f14b4
Author: dgozman <dgozman@chromium.org>
Date: Thu May 18 08:22:55 2017

[DevTools] Show icon in top toolbar when Node target is available

Clicking on it opens dedicated Node frontend.

BUG= 706916 

Review-Url: https://codereview.chromium.org/2890973002
Cr-Commit-Position: refs/heads/master@{#472739}

[modify] https://crrev.com/ad3ffab411cc396ffb20c1d35dcff6de038f14b4/chrome/browser/devtools/devtools_window.cc
[modify] https://crrev.com/ad3ffab411cc396ffb20c1d35dcff6de038f14b4/chrome/browser/devtools/devtools_window.h
[modify] https://crrev.com/ad3ffab411cc396ffb20c1d35dcff6de038f14b4/content/browser/devtools/protocol/target_handler.cc
[modify] https://crrev.com/ad3ffab411cc396ffb20c1d35dcff6de038f14b4/content/browser/devtools/protocol/target_handler.h
[modify] https://crrev.com/ad3ffab411cc396ffb20c1d35dcff6de038f14b4/third_party/WebKit/Source/devtools/BUILD.gn
[add] https://crrev.com/ad3ffab411cc396ffb20c1d35dcff6de038f14b4/third_party/WebKit/Source/devtools/front_end/Images/nodeIcon.png
[modify] https://crrev.com/ad3ffab411cc396ffb20c1d35dcff6de038f14b4/third_party/WebKit/Source/devtools/front_end/main/Main.js
[modify] https://crrev.com/ad3ffab411cc396ffb20c1d35dcff6de038f14b4/third_party/WebKit/Source/devtools/front_end/main/module.json
[add] https://crrev.com/ad3ffab411cc396ffb20c1d35dcff6de038f14b4/third_party/WebKit/Source/devtools/front_end/main/nodeIcon.css
[modify] https://crrev.com/ad3ffab411cc396ffb20c1d35dcff6de038f14b4/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
[modify] https://crrev.com/ad3ffab411cc396ffb20c1d35dcff6de038f14b4/third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js
[modify] https://crrev.com/ad3ffab411cc396ffb20c1d35dcff6de038f14b4/third_party/WebKit/Source/devtools/front_end/sources/threadsSidebarPane.css

Status: Fixed (was: Assigned)
Project Member

Comment 8 by bugdroid1@chromium.org, Jun 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/24309d877571d159bc14f871671ff0630d6f8d32

commit 24309d877571d159bc14f871671ff0630d6f8d32
Author: dgozman <dgozman@chromium.org>
Date: Thu Jun 08 17:48:46 2017

Revert of [DevTools] Show icon in top toolbar when Node target is available (patchset #3 id:40001 of https://codereview.chromium.org/2890973002/ )

Reason for revert:
See issue 727517

Original issue's description:
> [DevTools] Show icon in top toolbar when Node target is available
>
> Clicking on it opens dedicated Node frontend.
>
> BUG= 706916 
>
> Review-Url: https://codereview.chromium.org/2890973002
> Cr-Commit-Position: refs/heads/master@{#472739}
> Committed: https://chromium.googlesource.com/chromium/src/+/ad3ffab411cc396ffb20c1d35dcff6de038f14b4

TBR=pfeldman@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 706916 

Review-Url: https://codereview.chromium.org/2932703002
Cr-Commit-Position: refs/heads/master@{#478017}

[modify] https://crrev.com/24309d877571d159bc14f871671ff0630d6f8d32/chrome/browser/devtools/devtools_window.cc
[modify] https://crrev.com/24309d877571d159bc14f871671ff0630d6f8d32/chrome/browser/devtools/devtools_window.h
[modify] https://crrev.com/24309d877571d159bc14f871671ff0630d6f8d32/content/browser/devtools/protocol/target_handler.cc
[modify] https://crrev.com/24309d877571d159bc14f871671ff0630d6f8d32/content/browser/devtools/protocol/target_handler.h
[modify] https://crrev.com/24309d877571d159bc14f871671ff0630d6f8d32/third_party/WebKit/Source/devtools/BUILD.gn
[delete] https://crrev.com/8b9c7a26c3db8781e2d504d118882ef5ba8eb1ba/third_party/WebKit/Source/devtools/front_end/Images/nodeIcon.png
[modify] https://crrev.com/24309d877571d159bc14f871671ff0630d6f8d32/third_party/WebKit/Source/devtools/front_end/main/Main.js
[modify] https://crrev.com/24309d877571d159bc14f871671ff0630d6f8d32/third_party/WebKit/Source/devtools/front_end/main/module.json
[delete] https://crrev.com/8b9c7a26c3db8781e2d504d118882ef5ba8eb1ba/third_party/WebKit/Source/devtools/front_end/main/nodeIcon.css
[modify] https://crrev.com/24309d877571d159bc14f871671ff0630d6f8d32/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
[modify] https://crrev.com/24309d877571d159bc14f871671ff0630d6f8d32/third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js
[modify] https://crrev.com/24309d877571d159bc14f871671ff0630d6f8d32/third_party/WebKit/Source/devtools/front_end/sources/threadsSidebarPane.css

Project Member

Comment 9 by bugdroid1@chromium.org, Jun 8 2017

Labels: merge-merged-3124
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e06ccbe5c706e3704fe3fa94b047e5e8221f7c46

commit e06ccbe5c706e3704fe3fa94b047e5e8221f7c46
Author: Dmitry Gozman <dgozman@chromium.org>
Date: Thu Jun 08 19:38:16 2017

Revert of [DevTools] Show icon in top toolbar when Node target is available (patchset #3 id:40001 of https://codereview.chromium.org/2890973002/ )

Reason for revert:
See issue 727517

Original issue's description:
> [DevTools] Show icon in top toolbar when Node target is available
>
> Clicking on it opens dedicated Node frontend.
>
> BUG= 706916 
>
> Review-Url: https://codereview.chromium.org/2890973002
> Cr-Commit-Position: refs/heads/master@{#472739}
> Committed: https://chromium.googlesource.com/chromium/src/+/ad3ffab411cc396ffb20c1d35dcff6de038f14b4

TBR=pfeldman@chromium.org
BUG= 706916 

Review-Url: https://codereview.chromium.org/2932703002
Cr-Original-Commit-Position: refs/heads/master@{#478017}
Review-Url: https://codereview.chromium.org/2927063003 .
Cr-Commit-Position: refs/branch-heads/3124@{#4}
Cr-Branched-From: e88b4570354eca47bc65a98bbba6013f73c6c816-refs/heads/master@{#477839}

[modify] https://crrev.com/e06ccbe5c706e3704fe3fa94b047e5e8221f7c46/chrome/browser/devtools/devtools_window.cc
[modify] https://crrev.com/e06ccbe5c706e3704fe3fa94b047e5e8221f7c46/chrome/browser/devtools/devtools_window.h
[modify] https://crrev.com/e06ccbe5c706e3704fe3fa94b047e5e8221f7c46/content/browser/devtools/protocol/target_handler.cc
[modify] https://crrev.com/e06ccbe5c706e3704fe3fa94b047e5e8221f7c46/content/browser/devtools/protocol/target_handler.h
[modify] https://crrev.com/e06ccbe5c706e3704fe3fa94b047e5e8221f7c46/third_party/WebKit/Source/devtools/BUILD.gn
[delete] https://crrev.com/33567de95a7dd75f25d098f8338ffd19599bb0a3/third_party/WebKit/Source/devtools/front_end/Images/nodeIcon.png
[modify] https://crrev.com/e06ccbe5c706e3704fe3fa94b047e5e8221f7c46/third_party/WebKit/Source/devtools/front_end/main/Main.js
[modify] https://crrev.com/e06ccbe5c706e3704fe3fa94b047e5e8221f7c46/third_party/WebKit/Source/devtools/front_end/main/module.json
[delete] https://crrev.com/33567de95a7dd75f25d098f8338ffd19599bb0a3/third_party/WebKit/Source/devtools/front_end/main/nodeIcon.css
[modify] https://crrev.com/e06ccbe5c706e3704fe3fa94b047e5e8221f7c46/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
[modify] https://crrev.com/e06ccbe5c706e3704fe3fa94b047e5e8221f7c46/third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js
[modify] https://crrev.com/e06ccbe5c706e3704fe3fa94b047e5e8221f7c46/third_party/WebKit/Source/devtools/front_end/sources/threadsSidebarPane.css

Project Member

Comment 10 by bugdroid1@chromium.org, Jun 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ed459c553934485a18180313d892f53dfd4eae94

commit ed459c553934485a18180313d892f53dfd4eae94
Author: dgozman <dgozman@chromium.org>
Date: Thu Jun 15 23:02:05 2017

Reland of [DevTools] Show icon in top toolbar when Node target is available (patchset #1 id:1 of https://codereview.chromium.org/2932703002/ )

Reason for revert:
Fixed the original crash cause

Original issue's description:
> Revert of [DevTools] Show icon in top toolbar when Node target is available (patchset #3 id:40001 of https://codereview.chromium.org/2890973002/ )
>
> Reason for revert:
> See issue 727517
>
> Original issue's description:
> > [DevTools] Show icon in top toolbar when Node target is available
> >
> > Clicking on it opens dedicated Node frontend.
> >
> > BUG= 706916 
> >
> > Review-Url: https://codereview.chromium.org/2890973002
> > Cr-Commit-Position: refs/heads/master@{#472739}
> > Committed: https://chromium.googlesource.com/chromium/src/+/ad3ffab411cc396ffb20c1d35dcff6de038f14b4
>
> TBR=pfeldman@chromium.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG= 706916 
>
> Review-Url: https://codereview.chromium.org/2932703002
> Cr-Commit-Position: refs/heads/master@{#478017}
> Committed: https://chromium.googlesource.com/chromium/src/+/24309d877571d159bc14f871671ff0630d6f8d32

TBR=pfeldman@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 706916 ,727517

Review-Url: https://codereview.chromium.org/2939173002
Cr-Commit-Position: refs/heads/master@{#479882}

[modify] https://crrev.com/ed459c553934485a18180313d892f53dfd4eae94/chrome/browser/devtools/devtools_window.cc
[modify] https://crrev.com/ed459c553934485a18180313d892f53dfd4eae94/chrome/browser/devtools/devtools_window.h
[modify] https://crrev.com/ed459c553934485a18180313d892f53dfd4eae94/content/browser/devtools/protocol/target_handler.cc
[modify] https://crrev.com/ed459c553934485a18180313d892f53dfd4eae94/content/browser/devtools/protocol/target_handler.h
[modify] https://crrev.com/ed459c553934485a18180313d892f53dfd4eae94/third_party/WebKit/Source/devtools/BUILD.gn
[add] https://crrev.com/ed459c553934485a18180313d892f53dfd4eae94/third_party/WebKit/Source/devtools/front_end/Images/nodeIcon.png
[modify] https://crrev.com/ed459c553934485a18180313d892f53dfd4eae94/third_party/WebKit/Source/devtools/front_end/main/Main.js
[modify] https://crrev.com/ed459c553934485a18180313d892f53dfd4eae94/third_party/WebKit/Source/devtools/front_end/main/module.json
[add] https://crrev.com/ed459c553934485a18180313d892f53dfd4eae94/third_party/WebKit/Source/devtools/front_end/main/nodeIcon.css
[modify] https://crrev.com/ed459c553934485a18180313d892f53dfd4eae94/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
[modify] https://crrev.com/ed459c553934485a18180313d892f53dfd4eae94/third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js
[modify] https://crrev.com/ed459c553934485a18180313d892f53dfd4eae94/third_party/WebKit/Source/devtools/front_end/sources/threadsSidebarPane.css

I'm trying to understand why this bug titled
 improve the "waiting for debugger to disconnect" UX
was closed as fixed.

Using Version 62.0.3202.62 on Linux the //chrome:inspect workflow still blocks when node reaches "waiting for debugger to disconnect". 

The patches added here make it easier to *connect* to node, but that is not (has not) been the problem. The problem is to get node (or the devtools) to disconnect so we can then drive node in a loop (eg nodemon) and get a decent workflow.  

Not that when the node instance is block on "waiting for debugger to disconnect"
  on Linux: GET http://localhost:9229/json works,
  on MacOs: GET http://localhost:9229/json fails.



Status: Assigned (was: Fixed)
I agree, it's pretty painful to disconnect.

The "waiting" case was introduced for JS profiling..  so that devtools gets a chance to finish profiling and get the data. However this has since broke.

So the original motivation is moot.

And for non-profiling cases it's just obtrusive.
So at this point it'd be better to just remove entirely.
I managed to defeat the exit block by monitoring stderr and killing the nodejs process when I see the Waiting for debugger to disconnect" string.  After playing with this for a bit, I think there is a role for a related but different exit block, one positioned earlier, when the JS is still known to the debugger.

Unlike the browser, non-server nodejs (eg jasmine tests) exits when its event loop becomes idle. To set breakpoints in such code is silly hard to do. The --debug-brk does *not* work for nodejs because when it hits the js code is not loaded, so we can't set breakpoints in it. 

Suppose we had a --exit-block option:
  * If no breakpoints are hit, devtools breaks just before exiting JS. Devs can set breakpoints.
  * If profiling, devtools breaks just before exiting JS. Data collected.
  * Else (breakpoint hit or not  profiling), just exit normally.
Profiling could set the option assuming this feature needs the block.

This would support debugging of nodejs with devtools on non-server code.
Cc: dgozman@chromium.org
Owner: eostroukhov@chromium.org
Owner: hhli@chromium.org
Owner: alph@chromium.org
Status: Archived (was: Assigned)
Archiving feature requests that we are unlikely to address during the next 18 months.

Sign in to add a comment