-
Notifications
You must be signed in to change notification settings - Fork 639
Closed
Labels
🚨This issue needs some love.This issue needs some love.api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.triage meI really want to be triaged.I really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Milestone
Description
I believe I am reading the code correctly (please close this if I'm not!) -- based on the docs for transactions I should do something like this:
ds.runInTransaction(function(txn, done) {
txn.get(key, function(err, entity) {
if (err) {
txn.rollback(done);
}
});
}, function(err) {});
However if the rollback fails, we'll call done without ever setting isFinalized = true. I believe this means we'll then try to commit the transaction, which doesn't seem like the desired outcome. It's ok to just not rollback the transaction, eventually it will expire, so rollback should always immediately set isFinalized = true.
Also I'm not sure if this gets fixed at all by the refactor that's currently happening with Transaction.
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.triage meI really want to be triaged.I really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.