weacast / weacast-probe

Probing forecast model plugin for Weacast
MIT License
4 stars 1 forks source link

Probing is not reliable when used across network #3

Closed claustres closed 6 years ago

claustres commented 6 years ago

Steps to reproduce

Launch a Weacast instance running on a first server, https://github.com/weacast/weacast-loader running on a second server, MongoDB running on a third server.

Actual behavior

Some error messages are popping like this:

error: error: api/probe-results - Method: patch: connection 1 to mongodb:27017 timed out,
error: connection 6 to mongodb:27017 timed out,
,
/opt/app/modules/weacast-probe/node_modules/mongodb/lib/utils.js:123,
    process.nextTick(function() { throw err; });,
                                  ^,
MongoError: connection 5 to mongodb:27017 timed out,
    at Function.MongoError.create (/opt/app/modules/weacast-probe/node_modules/mongodb-core/lib/error.js:29:11),
    at Socket.<anonymous> (/opt/app/modules/weacast-probe/node_modules/mongodb-core/lib/connection/connection.js:198:20),
    at Object.onceWrapper (events.js:293:19),
    at emitNone (events.js:86:13),
    at Socket.emit (events.js:188:7),
    at Socket._onTimeout (net.js:352:8),
    at ontimeout (timers.js:386:14),
    at tryOnTimeout (timers.js:250:5),
    at Timer.listOnTimeout (timers.js:214:5),

Expected behavior

Probing works as when running on a single instance.

We probably need to both, increase the timeout for network access, perform bulk write instead of sending individual write request for each probe.

System configuration

Operating System: Linux Ubuntu

Module versions : 0.5.0

NodeJS version: 8