From f7a23a2d045e27b400f8bc3012dffca5565650df Mon Sep 17 00:00:00 2001 From: Aleksei Koziatinskii Date: Mon, 8 Aug 2016 12:17:31 -0700 Subject: [PATCH] inspector: fix inspector hang while disconnecting If user make some actions during (e.g. stepOver native call) that requests program break and disconnect DevTools frontend then AgentImpl won't be disconnected until other message from frontend. The root of issue: 1. Inspector requests program break. 2. User requests disconnect (e.g. refresh page with DevTools frontend). 3. On program break V8Inspector call runMessageLoopOnPause on V8NodeInspector. 4. Message loop will wait until next message from frontend. 5. After message Agent will be disconnected. We can dispatch all pending message on step 3 to solve a problem. PR-URL: https://github.com/nodejs/node/pull/8021 Reviewed-By: bnoordhuis - Ben Noordhuis --- src/inspector_agent.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index 5b6a8f01bb321e..f4f601e43ecf58 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -305,6 +305,7 @@ class V8NodeInspector : public blink::V8InspectorClient { return; terminated_ = false; running_nested_loop_ = true; + agent_->DispatchMessages(); do { { Mutex::ScopedLock scoped_lock(agent_->pause_lock_);