-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
inspector: Do not crash if the port is n/a #7874
Conversation
@@ -207,6 +207,7 @@ class AgentImpl { | |||
bool wait_; | |||
bool connected_; | |||
bool shutting_down_; | |||
bool startup_failed_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is starting to look like a state machine spread across several booleans. Consolidating them into an enum is cleaner and easier to reason about, IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review. I introduced initial set of states. Note that I am still working a refactoring that will split "inspector agent" (the one that lives on the main thread and talks to V8) and "inspector server" (that talks to a client over the socket - including all HTTP responses and such). Then there will be 2 objects with likely two states. In the current implementation, adding states for all flags (like shutting_down_ and wait_) would make the variable accessed (and modified) from both threads - which might introduce some race conditions (or require more synchronization than is neccessary now).
LGTM |
Node process will no longer terminate with an assertion if the inspector port is not available.
I added a missing space, as required by linter. |
LGTM |
Landed as f789eb3. |
Node process will no longer terminate with an assertion if the inspector port is not available. PR-URL: #7874 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Node process will no longer terminate with an assertion if the inspector port is not available. PR-URL: #7874 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: jasnell - James M Snell <jasnell@gmail.com> Conflicts: src/node.cc
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
deps:v8_inspector
Description of change
Node process will no longer terminate with an assertion if the inspector
port is not available.
CC: @ofrobots