googleapis / googleapis/google-cloud-java

[java-spanner] AsyncTransactionManager.CommitTimestampFuture violates Future.get contract

Open
#12,251 1 comment 0 reactions 1 assignee Assigned to @sakthivelmanii View on GitHub
api: spanner
Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
154

Description

`CommitTimestampFuture` violates the `Future` contract by overriding `get()` to throw any caught exception other than `ExecutionException`. Namely, it unwraps any `AbortedException` and throws that directly.

This breaks any downstream code that operates on that `CommitTimestampFuture` via the `Future` interface. For example, transforming it to a Guava `ListenableFuture` and then calling the `kotlinx.coroutines.guava.await` extension function on it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.