GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — src,worker: runtime error on pthread creation failure by HarshithaKP · Pull Request #32344 · nodejs/node Conversation
|
Instead of assertion failure, now we get a runtime error like this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Change looks good. Ideally this would come with a test but given the nature of the failure that's going to be difficult I'd imagine. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
when I was doing testing with this, I found this out: the error was not actually caught by the error handler, instead thrown as unahndled exception.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
throw error, so the caller can catch?
Yes, I’d suggest doing that.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please return here if the result of Set() is empty instead of using .Check().
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| w->object()->Set(w->env()->context(), | |
| w->env()->message_port_string(), | |
| Undefined(w->env()->isolate())).Check(); | |
| w->object()->Set(w->env()->context(), | |
| w->env()->message_port_string(), | |
| Undefined(w->env()->isolate())).Check(); |
(arguments should line up - but like Anna said, don't use Check().)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I find this ternary-heave style very hard to read. Can I suggest this?
Isolate* isolate = w->env()->isolate(); HandleScope handle_scope(isolate); // ... Local<Value> exit_code_v = Integer::New(isolate, w->exit_code_); Local<Value> null_v = Null(isolate).As<Value>(); Local<Value> argv[3] = {exit_code_v, null_v, null_v}; if (w->custom_error_ != nullptr) args[1] = OneByteString(isolate, w->custom_error_); if (!w->custom_error_str_.empty()) args[2] = OneByteString(isolate, w->custom_error_str_.c_str());
Or alternatively:
Local<Value> exit_code_v = Integer::New(isolate, w->exit_code_); Local<Value> null_v = Null(isolate).As<Value>(); Local<Value> custom_error_v = null_v; Local<Value> custom_error_str_v = null_v; if (w->custom_error_ != nullptr) custom_error_v = OneByteString(isolate, w->custom_error_); if (!w->custom_error_str_.empty()) custom_error_str_v = OneByteString(isolate, w->custom_error_str_.c_str()); Local<Value> argv[] = {exit_code_v, custom_error_v, custom_error_str_v};
I've left out the .As<Value>() casts because I don't think they're necessary here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fwiw, we don’t need the ternaries here anyway because we already know that custom_error_ and custom_error_str_ are set.
But either way, that should go away if this is converted to throwing an exception.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
with large number of worker threads pthread fails with hard assertion. Instead of hard assertion throw a runtime error. Refs: nodejs#32319
831cffc to
c064d2d
Compare
|
@addaleax and @bnoordhuis, PTAL. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| HandleScope handle_scope(isolate); | ||
| THROW_ERR_WORKER_INIT_FAILED(isolate, err_buf); | ||
| } | ||
| w->MakeWeak(); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| w->MakeWeak(); | |
| w->MakeWeak(); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@bnoordhuis, thanks. Fixed it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
please revert the file permissions back to 0644
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@devsnek, thanks. reverted the file permissions to 644. PTAL. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in b6459ec |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
With large number of worker threads pthread fails with hard assertion. Instead of hard assertion throw a runtime error. PR-URL: #32344 Fixes: #32319 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Instead of setting and then in the case of error un-setting properties, only set them when no error occurs. Refs: nodejs#32344
With large number of worker threads pthread fails with hard assertion. Instead of hard assertion throw a runtime error. PR-URL: #32344 Fixes: #32319 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Instead of setting and then in the case of error un-setting properties, only set them when no error occurs. Refs: #32344 PR-URL: #32562 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]>
There’s no reason for this to not be stored alongside the loop data structure itself. PR-URL: #32562 Refs: #32344 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]>
Instead of setting and then in the case of error un-setting properties, only set them when no error occurs. Refs: #32344 PR-URL: #32562 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]>
There’s no reason for this to not be stored alongside the loop data structure itself. PR-URL: #32562 Refs: #32344 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]>
Instead of setting and then in the case of error un-setting properties, only set them when no error occurs. Refs: #32344 PR-URL: #32562 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]>
There’s no reason for this to not be stored alongside the loop data structure itself. PR-URL: #32562 Refs: #32344 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]>
With large number of worker threads pthread fails with hard assertion. Instead of hard assertion throw a runtime error. PR-URL: nodejs#32344 Fixes: nodejs#32319 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Instead of setting and then in the case of error un-setting properties, only set them when no error occurs. Refs: nodejs#32344 PR-URL: nodejs#32562 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]>
There’s no reason for this to not be stored alongside the loop data structure itself. PR-URL: nodejs#32562 Refs: nodejs#32344 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]>
With large number of worker threads pthread fails with hard assertion. Instead of hard assertion throw a runtime error. PR-URL: #32344 Fixes: #32319 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Instead of setting and then in the case of error un-setting properties, only set them when no error occurs. Refs: #32344 PR-URL: #32562 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]>
There’s no reason for this to not be stored alongside the loop data structure itself. PR-URL: #32562 Refs: #32344 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
assertion failure in ../src/node_worker.cc:647 with 4K worker threads
There was an error while loading. Please reload this page.