leitwarte / ping

Package to check a host's availability
1 stars 0 forks source link

[BUG] "future resolved more than once" #1

Open lokenx opened 9 years ago

lokenx commented 9 years ago

Been using this package, but in some situations I get the below error:

Error: Future resolved more than once
    at Object.Future.return (/opt/pingmonitor/app/programs/server/node_modules/fibers/future.js:226:10)
    at packages/leitwarte:ping/ping.js:19:1
        at Socket.<anonymous> (/opt/pingmonitor/app/programs/server/npm/leitwarte_ping/node_modules/jjg-ping/lib/ping-system.js:82:25)

Not sure if it's your package, or the NPM package?

yauh commented 9 years ago

The fibers come from Meteor, so I'd assume it's from the package. Maybe @ciwolsey has an idea. Thanks for reporting :)

lokenx commented 9 years ago

Of note, most error's occur when the app has been bundled and deployed using MUP. Running it just in development mode with meteor only pops up once in awhile.

frpz commented 8 years ago

Hello, I have the same problem as you, lokenx, have you found a workaround?

lokenx commented 8 years ago

Not with the package, I ended up putting together a ping function myself, it's hacky and ugly but it worked (no Windows support because I didn't need it).

https://gist.github.com/lokenx/af0e7f46efdbe5064f36

frpz commented 8 years ago

I thing the problem comes from the jjg-ping package, it's because the result is a stream that calls the call back every time it receives new data. The network latency difference between the test and production server may explain why it only appends on prod, but not all the time.

This post explains the pb (with a different package): http://stackoverflow.com/questions/33308521/error-future-resolved-more-than-once

I'll try to do a pull request later to try to solve this pb.