Skip to content
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: add error message if we abort #8634

Closed
wants to merge 1 commit into from
Closed

Conversation

fhinkel
Copy link
Member

@fhinkel fhinkel commented Sep 17, 2016

Checklist
  • make -j4 test (UNIX) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

vm, watchdog

Description of change

Add an error message if we abort because uv_init_loop fails.

Fixes #8555

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Sep 17, 2016
@fhinkel fhinkel changed the title src: better error message on uv_loop_init failure Watchdog: add error message if we abort Sep 17, 2016
@@ -13,6 +13,10 @@ Watchdog::Watchdog(v8::Isolate* isolate, uint64_t ms) : isolate_(isolate),
loop_ = new uv_loop_t;
CHECK(loop_);
rc = uv_loop_init(loop_);
if (rc != 0) {
FatalError("node::Watchdog::Watchdog()",
Copy link
Member

@targos targos Sep 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: I think indentation should be 2 spaces here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching it! I keep forgetting that ESlint doesn't complain about C++ formatting. Does anybody want to share their vimrc with me for correct auto formatting?

@@ -13,6 +13,10 @@ Watchdog::Watchdog(v8::Isolate* isolate, uint64_t ms) : isolate_(isolate),
loop_ = new uv_loop_t;
CHECK(loop_);
rc = uv_loop_init(loop_);
if (rc != 0) {
FatalError("node::Watchdog::Watchdog()",
"Failed to initialize loop. Maybe the file limit is reached?");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: align with previous argument ?

@@ -13,6 +13,10 @@ Watchdog::Watchdog(v8::Isolate* isolate, uint64_t ms) : isolate_(isolate),
loop_ = new uv_loop_t;
CHECK(loop_);
rc = uv_loop_init(loop_);
if (rc != 0) {
FatalError("node::Watchdog::Watchdog()",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation looks off here.

@@ -13,6 +13,10 @@ Watchdog::Watchdog(v8::Isolate* isolate, uint64_t ms) : isolate_(isolate),
loop_ = new uv_loop_t;
CHECK(loop_);
rc = uv_loop_init(loop_);
if (rc != 0) {
FatalError("node::Watchdog::Watchdog()",
"Failed to initialize loop. Maybe the file limit is reached?");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the second part of this error message. If we can't say with certainty what the problem is, I don't think we should leave questions like this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could then check if the file limit was actually reached?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to make the message more helpful than just saying that the call failed. But I'm also OK with deleting the second part.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it say "initialize uv loop"? To give more context?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could then check if the file limit was actually reached?

That would be pretty nice. I’m not sure whether that’s feasible to do in a cross-platform way, but for POSIXes it probably would work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think @addaleax is right that it may be difficult to do x-platform reliably. The message could be extended a bit with something like, Failed to initialize loop. This may be caused, for instance, by reaching the file limit.

@@ -13,6 +13,10 @@ Watchdog::Watchdog(v8::Isolate* isolate, uint64_t ms) : isolate_(isolate),
loop_ = new uv_loop_t;
CHECK(loop_);
rc = uv_loop_init(loop_);
if (rc != 0) {
FatalError("node::Watchdog::Watchdog()",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry to bother you, but indentation is still off by 1.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, my fault for being sloppy.

@addaleax addaleax added the vm Issues and PRs related to the vm subsystem. label Sep 17, 2016
@imyller
Copy link
Member

imyller commented Sep 17, 2016

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending CI

Copy link
Member

@imyller imyller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@imyller
Copy link
Member

imyller commented Sep 18, 2016

Oh, @thealphanerd do you feel citgm should be run before landing this?

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but the commit message should start with vm: or maybe src:?

(I don’t think CITGM is really necessary here, but if somebody wants to run it, sure)

if (rc != 0) {
FatalError("node::Watchdog::Watchdog()",
"Failed to initialize uv loop.");
}
CHECK_EQ(0, rc);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line can be dropped.

Add an error message in watchdog if we abort because uv_loop_init fails.

Fixes nodejs#8555
@fhinkel
Copy link
Member Author

fhinkel commented Sep 20, 2016

I fixed the formatting, error message, extra CHECK, and commit message.

CI again: https://ci.nodejs.org/view/All/job/node-test-pull-request/4146/

@fhinkel fhinkel changed the title Watchdog: add error message if we abort src: add error message if we abort Sep 20, 2016
@jasnell
Copy link
Member

jasnell commented Sep 20, 2016

I don't believe it needs to be but should this be semver-major?

@cjihrig
Copy link
Contributor

cjihrig commented Sep 20, 2016

I don't think this should be semver major since it's an abort. I'd go with patch.

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@imyller
Copy link
Member

imyller commented Sep 22, 2016

@imyller
Copy link
Member

imyller commented Sep 23, 2016

I'll start landing this:

  • Four LGTMs
  • No objections
  • Requested modifications have been made
  • CI tests passed (only known CI failures; unrelated to this PR)

imyller pushed a commit to imyller/node that referenced this pull request Sep 23, 2016
Add an error message in watchdog if we abort because uv_loop_init fails.

PR-URL: nodejs#8634
Fixes: nodejs#8555
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@imyller
Copy link
Member

imyller commented Sep 23, 2016

landed in fba5319

Thank you, @fhinkel

@imyller imyller closed this Sep 23, 2016
@imyller imyller removed their assignment Sep 23, 2016
jasnell pushed a commit that referenced this pull request Sep 29, 2016
Add an error message in watchdog if we abort because uv_loop_init fails.

PR-URL: #8634
Fixes: #8555
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins
Copy link
Contributor

@fhinkel do you think this should be backported?

Fishrock123 pushed a commit that referenced this pull request Oct 11, 2016
Add an error message in watchdog if we abort because uv_loop_init fails.

PR-URL: #8634
Fixes: #8555
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins
Copy link
Contributor

ping @fhemberger

@fhemberger
Copy link
Contributor

I guess you wanted to ping @fhinkel. 😄

@MylesBorins
Copy link
Contributor

ping @fhinkel

@fhinkel
Copy link
Member Author

fhinkel commented Dec 21, 2016

If it lands cleanly, yes.

MylesBorins pushed a commit that referenced this pull request Jan 23, 2017
Add an error message in watchdog if we abort because uv_loop_init fails.

PR-URL: #8634
Fixes: #8555
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
Add an error message in watchdog if we abort because uv_loop_init fails.

PR-URL: #8634
Fixes: #8555
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Feb 1, 2017
Add an error message in watchdog if we abort because uv_loop_init fails.

PR-URL: #8634
Fixes: #8555
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. vm Issues and PRs related to the vm subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vm: node crashes if timeout is set and nofile limit is reached
10 participants