-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
async_hooks,async_wrap: fixups and fewer aborts #14722
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
Changes from all commits
f5ef678
0f863d0
f2c1638
14c3a5e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,8 +127,8 @@ inline v8::Local<v8::String> Environment::AsyncHooks::provider_string(int idx) { | |
|
||
inline void Environment::AsyncHooks::push_ids(double async_id, | ||
double trigger_id) { | ||
CHECK_GE(async_id, 0); | ||
CHECK_GE(trigger_id, 0); | ||
CHECK_GE(async_id, -1); | ||
|
||
CHECK_GE(trigger_id, -1); | ||
|
||
ids_stack_.push({ uid_fields_[kCurrentAsyncId], | ||
uid_fields_[kCurrentTriggerId] }); | ||
|
@@ -176,20 +176,23 @@ inline void Environment::AsyncHooks::clear_id_stack() { | |
inline Environment::AsyncHooks::InitScope::InitScope( | ||
Environment* env, double init_trigger_id) | ||
: env_(env), | ||
uid_fields_(env->async_hooks()->uid_fields()) { | ||
env->async_hooks()->push_ids(uid_fields_[AsyncHooks::kCurrentAsyncId], | ||
uid_fields_ref_(env->async_hooks()->uid_fields()) { | ||
CHECK_GE(init_trigger_id, -1); | ||
env->async_hooks()->push_ids(uid_fields_ref_[AsyncHooks::kCurrentAsyncId], | ||
init_trigger_id); | ||
} | ||
|
||
inline Environment::AsyncHooks::InitScope::~InitScope() { | ||
env_->async_hooks()->pop_ids(uid_fields_[AsyncHooks::kCurrentAsyncId]); | ||
env_->async_hooks()->pop_ids(uid_fields_ref_[AsyncHooks::kCurrentAsyncId]); | ||
} | ||
|
||
inline Environment::AsyncHooks::ExecScope::ExecScope( | ||
Environment* env, double async_id, double trigger_id) | ||
: env_(env), | ||
async_id_(async_id), | ||
disposed_(false) { | ||
CHECK_GE(async_id, -1); | ||
CHECK_GE(trigger_id, -1); | ||
env->async_hooks()->push_ids(async_id, trigger_id); | ||
} | ||
|
||
|
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.
Could you add perfunctory tests in
test/parallel/test-internal-errors.js
as per https://github.com/nodejs/node/blob/master/doc/guides/using-internal-errors.md#testing-new-errorsThere 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