-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
src: destroy inspector agent before context #16472
Conversation
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.
LGTM with suggestions.
src/env.h
Outdated
@@ -668,7 +668,7 @@ class Environment { | |||
|
|||
#if HAVE_INSPECTOR | |||
inline inspector::Agent* inspector_agent() { |
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 method can be const
now.
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.
Thanks. Done.
src/env.h
Outdated
@@ -713,7 +713,7 @@ class Environment { | |||
std::map<std::string, uint64_t> performance_marks_; | |||
|
|||
#if HAVE_INSPECTOR | |||
inspector::Agent inspector_agent_; | |||
inspector::Agent* inspector_agent_ = nullptr; |
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.
I'd make this inspector::Agent* const inspector_agent_;
, that way the compiler will complain if someone forgets to assign it in the constructor.
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.
Done.
src/env-inl.h
Outdated
@@ -347,6 +347,11 @@ inline Environment::Environment(IsolateData* isolate_data, | |||
inline Environment::~Environment() { | |||
v8::HandleScope handle_scope(isolate()); | |||
|
|||
#if HAVE_INSPECTOR | |||
// Destory inspector agent before erasing the context. |
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.
Typo: Destroy
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.
Done.
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 looking into this.
I did some manual testing and do not anticipate any regressions.
The CI looks green. I am planning to land this later today, i.e. less than 48 hrs after opening the PR, as this is a minor bug fix and that it fixes flakiness issues with inspector tests in the CI. |
The inspector_agent depends on the context still being accessible during the destructor execution. PR-URL: nodejs#16472 Fixes: nodejs#15558 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Thanks. Landed as e3503ac. |
The inspector_agent depends on the context still being accessible during the destructor execution. PR-URL: nodejs/node#16472 Fixes: nodejs/node#15558 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
The inspector_agent depends on the context still being accessible during the destructor execution. PR-URL: #16472 Fixes: #15558 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
The inspector_agent depends on the context still being accessible during the destructor execution. PR-URL: #16472 Fixes: #15558 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
The inspector_agent depends on the context still being accessible during the destructor execution. PR-URL: #16472 Fixes: #15558 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
The inspector_agent depends on the context still being accessible during the destructor execution. PR-URL: nodejs/node#16472 Fixes: nodejs/node#15558 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
The inspector_agent depends on the context still being accessible
during the destructor execution.
Fixes: #15558
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
inspector
CI: https://ci.nodejs.org/job/node-test-pull-request/10954/https://ci.nodejs.org/job/node-test-pull-request/10969/