GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Commit called if rollback fails · Issue #237 · googleapis/google-cloud-node

Commit called if rollback fails #237

New issue
Copy link
New issue
Copy link
Closed
#240
Closed
Commit called if rollback fails#237
#240
Copy link
Assignees
stephenplusplus
Labels
🚨This issue needs some love.api: datastoreIssues related to the Datastore API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
Milestone
Datastore Stable

Description

@pcostell
pcostell
opened on Sep 22, 2014
Issue body actions

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.

Activity

Next
  1. stephenplusplus
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Sep 22, 2014
  2. stephenplusplus commented on Sep 22, 2014

    @stephenplusplus
    stephenplusplus
    on Sep 22, 2014
    Contributor
    More actions

    You're right. If the rollback fails, when Transaction.prototype.finalize gets called, it won't see that a rollback was attempted, and it will try to commit. Your suggested fix sounds good to me.

  3. stephenplusplus
    added 2 commits that reference this issue on Sep 23, 2014

    datastore: mark failed rollbacks as finalized

    This issue will close once commit da2eaf9 is merged into the 'master' branch.
    da2eaf9

    datastore: mark failed rollbacks as finalized

    This issue will close once commit 56efd43 is merged into the 'master' branch.
    56efd43
  4. stephenplusplus
    added
    in progress
    on Sep 23, 2014
  5. stephenplusplus
    added 2 commits that reference this issue on Sep 23, 2014

    datastore: mark failed rollbacks as finalized

    This issue will close once commit fd861f7 is merged into the 'master' branch.
    fd861f7

    datastore: mark failed rollbacks as finalized

    This issue will close once commit 6defb3a is merged into the 'master' branch.
    6defb3a
  6. stephenplusplus
    closed this as completedin #240on Sep 30, 2014
  7. stephenplusplus
    removed
    in progress
    on Sep 30, 2014
  8. jgeewax
    added
    api: datastoreIssues related to the Datastore API.
    on Feb 2, 2015
  9. jgeewax
    changed the title [-]bug(datastore): commit called if rollback fails[/-] [+]Commit called if rollback fails[/+] on Feb 2, 2015
  10. jgeewax
    added this to the Datastore Stable milestone on Feb 2, 2015
  11. yoshi-automation
    added
    triage meI really want to be triaged.
    🚨This issue needs some love.
    on Apr 6, 2020
  12. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  13. 29 remaining items

  14. sofisl
    added 2 commits that reference this issue on Feb 4, 2026

    refactor: modernize the sample tests (#237)

    563e268

    fix(deps): update dependency through2 to v3 (#237)

    725cee6
  15. sofisl
    added a commit that references this issue on Feb 17, 2026

    fix(deps): update dependency through2 to v3 (#237)

    5c38d65
  16. sofisl
    added 2 commits that reference this issue on Feb 24, 2026

    Adding GTS Formatting (#237)

    639ec56

    refactor(es6): Refactor constructor pattern as ES6 class (#246)

    6a1657e
  17. codyoss
    added a commit that references this issue on Mar 5, 2026

    refactor(nodejs): move build cop to flakybot (#237)

    5bb3a1a
  18. sofisl
    added a commit that references this issue on Mar 5, 2026

    chore: migrate code from googleapis/gcp-metadata (#53)

    fa9a454
  19. codyoss
    added 2 commits that reference this issue on Mar 9, 2026

    chore(node): fix kokoro build path for cloud-rad (#237)

    75d8109

    chore(node): fix kokoro build path for cloud-rad (#237)

    5e7d6e3
  20. GautamSharda
    added a commit that references this issue on Mar 12, 2026

    chore(deps): update dependency nock to v10 (#237)

    e6b9de9
  21. thiyaguk09
    added a commit that references this issue on Mar 18, 2026

    refactor(es6): Refactor constructor pattern as ES6 class (googleapis#246

    7442337
  22. GautamSharda
    added 2 commits that reference this issue on Mar 23, 2026

    chore(deps): lock file maintenance (#237)

    d6403d9

    chore(deps): lock file maintenance (#237)

    1bb959e
  23. shivanee-p
    added a commit that references this issue on Mar 27, 2026

    chore(deps): lock file maintenance (#237)

    0130fd9
  24. thiyaguk09
    added a commit that references this issue on May 5, 2026

    chore(deps): lock file maintenance (googleapis#237)

    f78e788
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

🚨This issue needs some love.api: datastoreIssues related to the Datastore API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    • Datastore Stable

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.