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

App crashing occasionally when try to ping hosts through net-ping. #38

Closed
RomanBurunkov opened this issue Apr 27, 2017 · 7 comments
Closed

Comments

@RomanBurunkov
Copy link

RomanBurunkov commented Apr 27, 2017

Hi,

I'm getting this errors in logs and then app crashs.

node: ../deps/uv/src/unix/poll.c:88: uv_poll_stop: Assertion !(handle->flags & (UV_CLOSING | UV_CLOSED))' failed.`

This happens on Ubuntu server with running node v6.10.0 and net-ping v. 1.2.0

I've found that recently node-uptime project facing with such proplem:
https://groups.google.com/forum/#!topic/nodejs/obdxquewUcE

This usually happens when network has performance issues, such as packet lost and transmit/receive delays. In my app case this could happen 5-7 times for 24 hours.

My ping code looks like this:\

getPing = function(session, host, cbSuccess, cbError, reqTimeout){
  if(!session){
    var timeout   = (reqTimeout || 2)*1000;
    var session   = netPing.createSession({
      packetSize : 64,
      retries    : 2,
      timeout    : timeout 
    });
    session.on('error', function(error){
      logMsg(`ping error ${host} error: ` + error.toString());
      session.close ();
    });
  }
  session.pingHost(host, (error, target, sent, rcvd)=>{
    if(error) {
      cbError(error.toString());
    } else {
      var rtt = rcvd - sent;
      cbSuccess({status:'ok', result:'ok', data:rtt});
    }
    session.close();
  });
  return session;
}

Thanks, Roman.

@stephenwvickers
Copy link
Collaborator

What version of raw-socket are you using, can you look at the package.json file under its directory (under node_modules or wherever it is installed) and give me the exact version?

Steve

@stephenwvickers
Copy link
Collaborator

stephenwvickers commented Apr 27, 2017

Also, I don't see what relevance the link you gave has, it seems to relate to an issue which is not caused by this module.

@RomanBurunkov
Copy link
Author

Hello Stephen, the version is:
├─┬ net-ping@1.2.0 │ └─┬ raw-socket@1.5.1 │ └── nan@2.3.5

Sorry, I've posted a wrong link.
Here is another one: https://groups.google.com/forum/#!topic/node-uptime/Ee7IjIXeCow

@stephenwvickers
Copy link
Collaborator

Hi, is this still an issue for you?

@RomanBurunkov
Copy link
Author

Hello @stephenwvickers ,

Unfortunately yes.
It is actual and this one #37 too.

Still have no time to debug this, but planing to look deeper into this.
May be you can advice something how to debug this.

My app crashes or stops getting answers from net-ping if network have any performance problem(timeout, cognitions and etc, I'm using it via internet, not only in local network).

Will update this issue when have something to add.

@stephenwvickers
Copy link
Collaborator

Hi, have you had time to look into this?

@santhosh-ktec
Copy link

I predict the issue is here

    var session   = netPing.createSession({
      packetSize : 64,
      retries    : 2,
      timeout    : timeout 
    });

You should not set var before session here. If you set the session is limited to the scope of if condition if(!session) and session.pingHost will throw error still the global scope is not modified (null or undefined).
Hope this will fix ur issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants