josephg / node-foundationdb

Modern Node.js FoundationDB bindings
Other
115 stars 17 forks source link

Unhandled promise rejection when restarting one of FDB nodes #37

Closed aikoven closed 4 years ago

aikoven commented 4 years ago

My app is doing serial read-modify-write transactions, and when I restart one of FDB nodes, I get unhandled promise rejections:

  FDBError {
    code: 2020,
    message: "Transaction does not have a valid commit version"
  }

I'm not sure where these are coming from, because there's no stack trace. Though I'm pretty sure they don't come from my code, which looks like this:

async function main() {
  while (true) {
    await doTransaction(...);
    await delay(...);
  }
}

main().catch(err => console.error(err));

so there's no potential for unhandled rejections.

josephg commented 4 years ago

Thanks for the report. That does indeed sound like a bug in node-foundationdb; and that flow is not something I've exercised a lot. I'll see if I can reproduce it.

aikoven commented 4 years ago

Apparently it was a bug in my code.