Uh oh!
There was an error while loading. Please reload this page.
inspector: fix inspector::Agent::HasConnectedSessions - #20614
inspector: fix inspector::Agent::HasConnectedSessions#20614helloshuangzi wants to merge 1 commit into
Conversation
eugeneo
commented
May 9, 2018
It is possible to build Node without the inspector. Should that mode be used for embedding? |
@eugeneo Thanks for the quick response! |
eugeneo
commented
May 9, 2018
I am still not comfortable with this fix, because it means the rest of the Node is unaware that the inspector might be missing. I assume the issue you are facing is because of WaitForInspectorDisconnect call in node.cc. Would it be possible not to call it instead? I think we should not reference env->inspector_agent at all if the Inspector is not properly setup. |
helloshuangzi
commented
May 9, 2018
Thanks for the suggestion, but I am not calling WaitForInspectorDisconnect. LoadEnvironment(&env); |
eugeneo
commented
May 9, 2018
Then it looks like console should not be pinging inspector when the inspector is n/a. IMHO, the best fix would still be to compile without the inspector altogether if it is not needed. Anyway, I will not be blocking this PR. |
helloshuangzi
commented
May 9, 2018
eugeneo
commented
May 9, 2018
@helloshuangzi try |
helloshuangzi
commented
May 9, 2018
@eugeneo I know that flag, and it did help embedding scenarios if it works, but not for addon scenarios. Because the addon will depend on a self-built node to run it. It would be a significant drawback if an addon can't run with the official release version of node.js. |
addaleax
commented
May 9, 2018
@eugeneo I think that’s not a viable long-term solution for embedders. |
eugeneo
commented
May 9, 2018
@addaleax inspector::Agent::Start should always be called if the inspector::Agent instance had been created (i.e. if the Node was built with the inspector support). I will work on that fix when I have some time. As I said, I am not blocking this PR. |
addaleax
commented
May 10, 2018
helloshuangzi
commented
May 11, 2018
I noticed there were unsuccessful checks in the last CI, which can also be found for other PRs yesterday. I think it may got fixed by newly landed commits, so I just rebased it by the latest master. Please let me know if I should not do this after a collaborator started CI. |
eugeneo
commented
May 11, 2018
addaleax
commented
May 14, 2018
Landed in 34ca9f3 |
PR-URL: #20614 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #20614 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#20614 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
In Agent::HasConnectedSessions, return false if client_ is nullptr.
That's possible when inspector setting is skipped for embedding/addon scenarios.
It makes the code more robust at least, otherwise, crash will happen here.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes