Skip to content

TransactionRunner can get stuck if the first statement is a query and ResultSet#next() is never called #641

@olavloite

Description

@olavloite

The following transaction will wait indefinitely because the first query of the transaction will never actually be executed. All subsequent statements will however wait for a transaction id to be returned by this query.

DatabaseClient client =         spanner.getDatabaseClient(DatabaseId.of("p", "i", "d")); client.readWriteTransaction().run(new TransactionCallable<Void>() {       @Override       public Void run(TransactionContext transaction) throws Exception {         transaction.executeQuery("SELECT 1"); // Any RPC on the transaction after this will hang, including the Commit call that will         // be executed when this method returns. So this transaction will never finish.         return null;       } });

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/java-spanner API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions