google-cloud-firestore 2.6.2 → 2.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51025089f3e6c639d79f28dd536baf2d879233250fced0a8cda7a2c0fe16e9cd
4
- data.tar.gz: e93e7a44cebf91f11c7b9c93d73d0bb63db718af6d108e3563006ee49872c8be
3
+ metadata.gz: 43a875c5288189790070d70828e54d6a4d094979c0f2443c557a6e4fd3de1915
4
+ data.tar.gz: 982a614359a38a6227d8498a5d36f8fe49f2a198c7c9b3561b8e2d24bec07476
5
5
  SHA512:
6
- metadata.gz: 3ce514ce05e63d63ff9ffaa1a6adcb065f63315a87f3a8b6a8556761de9d962754b4b7433bcc8c543be2325b46f0401d8f858cce4ce3b100ef1d66cbbe15c342
7
- data.tar.gz: 00017f0d65b023e17bed35a0d55b9548cc44f1f78bb87c1e5f888544675956f434de40ff5e8d7f808845b7c959ef96763e118f221cebb8facbc7c1ea52018544
6
+ metadata.gz: bb4b447824f289da585555d5210a4672872b7b8e99ca5c5c4a02577637b7d74565da923adb1ae2776d888645c2836e785a70f6080acdc0541c35482fd1dfbd08
7
+ data.tar.gz: 4a0641708dee2f1b923aeb3bf2aeca4b7517bd45fca9762376c2b1b16bf3cb1c8cd7b96956498c9031ec52c15662d1b9ea88e4f828cbb5f907a17ad7d54be41e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 2.6.3 / 2021-08-24
4
+
5
+ #### Bug Fixes
6
+
7
+ * Fix transaction retry behavior
8
+
3
9
  ### 2.6.2 / 2021-07-26
4
10
 
5
11
  #### Bug Fixes
@@ -628,7 +628,24 @@ module Google
628
628
  commit_return = transaction.commit
629
629
  # Conditional return value, depending on truthy commit_response
630
630
  commit_response ? commit_return : transaction_return
631
- rescue Google::Cloud::UnavailableError => e
631
+ rescue Google::Cloud::AbortedError,
632
+ Google::Cloud::CanceledError,
633
+ Google::Cloud::UnknownError,
634
+ Google::Cloud::DeadlineExceededError,
635
+ Google::Cloud::InternalError,
636
+ Google::Cloud::UnauthenticatedError,
637
+ Google::Cloud::ResourceExhaustedError,
638
+ Google::Cloud::UnavailableError,
639
+ Google::Cloud::InvalidArgumentError => e
640
+
641
+ if e.instance_of? Google::Cloud::InvalidArgumentError
642
+ # Return if a previous call was retried but ultimately succeeded
643
+ return nil if backoff[:current].positive?
644
+ # The Firestore backend uses "INVALID_ARGUMENT" for transaction IDs that have expired.
645
+ # While INVALID_ARGUMENT is generally not retryable, we retry this specific case.
646
+ raise e unless e.message =~ /transaction has expired/
647
+ end
648
+
632
649
  # Re-raise if retried more than the max
633
650
  raise e if backoff[:current] > backoff[:max]
634
651
 
@@ -643,12 +660,6 @@ module Google
643
660
  transaction = Transaction.from_client \
644
661
  self, previous_transaction: transaction.transaction_id
645
662
  retry
646
- rescue Google::Cloud::InvalidArgumentError => e
647
- # Return if a previous call was retried but ultimately succeeded
648
- return nil if backoff[:current].positive?
649
-
650
- # Re-raise error.
651
- raise e
652
663
  rescue StandardError => e
653
664
  # Rollback transaction when handling unexpected error
654
665
  transaction.rollback rescue nil
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Firestore
19
- VERSION = "2.6.2".freeze
19
+ VERSION = "2.6.3".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-firestore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2
4
+ version: 2.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-26 00:00:00.000000000 Z
11
+ date: 2021-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core