thinky icon indicating copy to clipboard operation
thinky copied to clipboard

Unhandled rejection reported by thinky/rethinkdbdash when db host is not running

Open lillereven opened this issue 9 years ago • 4 comments

During testing I chanced upon this:

Unhandled rejection ReqlDriverError: None of the pools have an opened connection and failed to open a new one.
    at PoolMaster._flushErrors (/Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/lib/pool_master.js:96:31)
    at Pool.<anonymous> (/Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/lib/pool_master.js:444:12)
    at emitNone (events.js:80:13)
    at Pool.emit (events.js:179:7)
    at Pool._decreaseNumConnections (/Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/lib/pool.js:115:10)
    at /Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/lib/pool.js:289:10
    at tryCatcher (/Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/node_modules/bluebird/js/release/util.js:11:23)
    at /Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/node_modules/bluebird/js/release/catch_filter.js:24:41
    at tryCatcher (/Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/node_modules/bluebird/js/release/util.js:11:23)
    at Promise._settlePromiseFromHandler (/Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/node_modules/bluebird/js/release/promise.js:491:31)
    at Promise._settlePromise (/Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/node_modules/bluebird/js/release/promise.js:548:18)
    at Promise._settlePromise0 (/Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/node_modules/bluebird/js/release/promise.js:593:10)
    at Promise._settlePromises (/Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/node_modules/bluebird/js/release/promise.js:672:18)
    at Async._drainQueue (/Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/node_modules/bluebird/js/release/async.js:125:16)
    at Async._drainQueues (/Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/node_modules/bluebird/js/release/async.js:135:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/martin/WebstormProjects/gp1pro/node_modules/rethinkdbdash/node_modules/bluebird/js/release/async.js:16:14)

This is using thinky 2.2.4 w/ rethinkdb 2.2.3-1

lillereven avatar Jan 29 '16 00:01 lillereven

Hum, this is working as intended, though maybe we should call process.exit(1) What happens here is that we can't actually create the database, so from there we can't make sure that anything will work.

neumino avatar Feb 01 '16 00:02 neumino

It's definitively not optimal though.

neumino avatar Feb 01 '16 00:02 neumino

True, it's not optimal. Would it be possible to let the error bubble so the app has a chance to log stuff and retry? That way the app could recover when the DB comes back online.

lillereven avatar Feb 01 '16 16:02 lillereven

@lillereven -- You can try this comment and you can prevent the driver from writing to stderr by passing silent: true

Justkant avatar Jun 26 '16 11:06 Justkant