-
Notifications
You must be signed in to change notification settings - Fork 75
Closed
Labels
api: firestoreIssues related to the googleapis/java-firestore API.Issues related to the googleapis/java-firestore API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
OS: Linux
openjdk version 11.0.11
firebase-admin:7.3.0
google-cloud-firestore:2.5.0
A transaction with the local emulator that always throws an exception is constantly retried and never times out:
var options = FirestoreOptions
.getDefaultInstance()
.toBuilder()
.setProjectId(Config.GOOGLE_CLOUD_PROJECT)
.setEmulatorHost("localhost:9000")
.setCredentials(new FirestoreOptions.EmulatorCredentials());
var firestore = options.build().getService();
firestore
.runAsyncTransaction(
tx -> {
log.info("Hello world");
throw new RuntimeException("Fail");
// return ApiFutures.immediateFuture("OK");
}
)
.get();If I replace the throw statement with return, the invocation finishes successfully.
I also tried adding the following, and it didn't work:
options.setRetrySettings(
RetrySettings
.newBuilder()
.setMaxAttempts(1)
.setTotalTimeout(Duration.ofSeconds(2))
.setInitialRpcTimeout(Duration.ofSeconds(2))
.setMaxRpcTimeout(Duration.ofSeconds(2))
.build()
)I expected the following:
- Transaction retries to expire after 60 seconds
- With the second example, the transaction to stop retrying after one failed attempt or 2 seconds passed.
Did I miss something?
Metadata
Metadata
Assignees
Labels
api: firestoreIssues related to the googleapis/java-firestore API.Issues related to the googleapis/java-firestore API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.