ExchangeUnion / xud

Exchange Union Daemon 🔁 ⚡️
https://exchangeunion.com
GNU Affero General Public License v3.0
115 stars 44 forks source link

Ugly error when running `npm run test` - no impact on results #516

Closed offerm closed 6 years ago

offerm commented 6 years ago

when running the tests there is an ugly error which has no impact in the test run.

Error: ConnectionManager.getConnection was called after the connection manager was closed!
    at ConnectionManager.getConnection (/home/travis/build/ExchangeUnion/xud/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:86:29)
    at Promise.try (/home/travis/build/ExchangeUnion/xud/node_modules/sequelize/lib/sequelize.js:554:34)
    at tryCatcher (/home/travis/build/ExchangeUnion/xud/node_modules/bluebird/js/release/util.js:16:23)
    at Function.Promise.attempt.Promise.try (/home/travis/build/ExchangeUnion/xud/node_modules/bluebird/js/release/method.js:39:29)
    at retryParameters (/home/travis/build/ExchangeUnion/xud/node_modules/sequelize/lib/sequelize.js:454:48)
    at /home/travis/build/ExchangeUnion/xud/node_modules/retry-as-promised/index.js:39:21
    at Promise._execute (/home/travis/build/ExchangeUnion/xud/node_modules/bluebird/js/release/debuggability.js:303:9)
    at Promise._resolveFromExecutor (/home/travis/build/ExchangeUnion/xud/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/home/travis/build/ExchangeUnion/xud/node_modules/bluebird/js/release/promise.js:79:10)
    at retryAsPromised (/home/travis/build/ExchangeUnion/xud/node_modules/retry-as-promised/index.js:29:10)
    at Sequelize.query (/home/travis/build/ExchangeUnion/xud/node_modules/sequelize/lib/sequelize.js:454:12)
    at QueryInterface.update (/home/travis/build/ExchangeUnion/xud/node_modules/sequelize/lib/query-interface.js:1028:27)
    at Promise.try.then.then.then (/home/travis/build/ExchangeUnion/xud/node_modules/sequelize/lib/model.js:3691:53)
    at tryCatcher (/home/travis/build/ExchangeUnion/xud/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/travis/build/ExchangeUnion/xud/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/home/travis/build/ExchangeUnion/xud/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/home/travis/build/ExchangeUnion/xud/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/home/travis/build/ExchangeUnion/xud/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/home/travis/build/ExchangeUnion/xud/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/home/travis/build/ExchangeUnion/xud/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/travis/build/ExchangeUnion/xud/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)
sangaman commented 6 years ago

Seeing this too intermittently, definitely something that would be nice to get rid of. I'm looking up the error.

sangaman commented 6 years ago

I've figured out the issue, I'll open a PR to fix.

The problem is two fold:

  1. The web proxy test is defaulting initDb to true, which is unnecessary
  2. Part of the init db process adds the seed nodes to the database, which in turn creates outgoing connections to the the seed nodes. The connections are async, and frequently what happens is that the web proxy tests complete and call the shutdown method which closes the db before the connections complete. When the connections complete, they try to update the nodes table after the db has been closed.
offerm commented 6 years ago

👍

On Tue, 25 Sep 2018 at 8:51 Daniel McNally notifications@github.com wrote:

I've figured out the issue, I'll open a PR to fix.

The problem is two fold:

  1. The web proxy test is defaulting initDb to true, which is unnecessary
  2. Part of the init db process adds the seed nodes to the database, which in turn creates outgoing connections to the the seed nodes. The connections are async, and frequently what happens is that the web proxy tests complete and call the shutdown method which closes the db before the connections complete. When the connections complete, they try to update the nodes table after the db has been closed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ExchangeUnion/xud/issues/516#issuecomment-424215680, or mute the thread https://github.com/notifications/unsubscribe-auth/AJQ0cnnu0gSs8cyFIRZEDCPIfoeh-Sscks5uecR3gaJpZM4W1VSA .