google-cloud-pubsub 2.12.0 → 2.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19d022ba204052f7d871418daa55ed9b47f9e6786abe0c2bc996eba6e31f393e
4
- data.tar.gz: 5440bfb2fa042c83d0e9ea22a3bd974c517c9d7c771b291ddbe953b7f622100f
3
+ metadata.gz: afdce505d87a251a0408c830e80728cf68506cf5631013cfcdae0bc18dba549b
4
+ data.tar.gz: c46a1e91681598c21d1b4014b6fb0aadb7f8575c9c08e2c9a13ac8b91de87ed6
5
5
  SHA512:
6
- metadata.gz: 0a487ba4783cb96c663b7ff96311b6514ec851aca7d0985b391574ff1161b19f8aaed391fdc3571f68103c43ab3244adc6d79e9f2a13b3a99fab792139b4da56
7
- data.tar.gz: 683a30d9cd5db86e950323205007ac1e83796b386929bb41d4ed5978c1e984debdd0f7f08a273f1ff6fed4c0fcbaef4e9b5cfcfcec11c37e0ab48078ba64e50a
6
+ metadata.gz: 6a31118080d4ad3a6a03b1911f6ec192dfe51021140bea354568c128856bd86cfbea79fd75d6fc6457a68e7266f018f9ef1e23868ee074576539f71916f8bc57
7
+ data.tar.gz: 4b9ff30c34dd3e08456dce04434e7e9da0552048dc86980d3b82f0af1114377601c7a96d71e1738973df0a506302dc5a7919ac900616b7b2fca58951891e5dfc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 2.12.1 (2022-08-21)
4
+
5
+ #### Bug Fixes
6
+
7
+ * update non EOS ack to return Success always ([#19023](https://github.com/googleapis/google-cloud-ruby/issues/19023))
8
+
3
9
  ### 2.12.0 (2022-08-09)
4
10
 
5
11
  #### Features
@@ -204,7 +204,12 @@ module Google
204
204
  #
205
205
  def acknowledge! &block
206
206
  ensure_subscription!
207
- subscription.acknowledge ack_id, &block
207
+ if subscription.respond_to?(:exactly_once_delivery_enabled) && subscription.exactly_once_delivery_enabled
208
+ subscription.acknowledge ack_id, &block
209
+ else
210
+ subscription.acknowledge ack_id
211
+ yield AcknowledgeResult.new(AcknowledgeResult::SUCCESS) if block_given?
212
+ end
208
213
  end
209
214
  alias ack! acknowledge!
210
215
 
@@ -265,7 +270,12 @@ module Google
265
270
  #
266
271
  def modify_ack_deadline! new_deadline, &block
267
272
  ensure_subscription!
268
- subscription.modify_ack_deadline new_deadline, ack_id, &block
273
+ if subscription.respond_to?(:exactly_once_delivery_enabled) && subscription.exactly_once_delivery_enabled
274
+ subscription.modify_ack_deadline new_deadline, ack_id, &block
275
+ else
276
+ subscription.modify_ack_deadline new_deadline, ack_id
277
+ yield AcknowledgeResult.new(AcknowledgeResult::SUCCESS) if block_given?
278
+ end
269
279
  end
270
280
 
271
281
  ##
@@ -35,11 +35,11 @@ module Google
35
35
 
36
36
  PERMANENT_FAILURE = "PERMANENT_FAILURE".freeze
37
37
  # Google::Cloud::Unavailable error is already retried at gapic level
38
- RETRIABLE_ERRORS = [Google::Cloud::CanceledError,
39
- Google::Cloud::DeadlineExceededError,
40
- Google::Cloud::InternalError,
41
- Google::Cloud::ResourceExhaustedError,
42
- Google::Cloud::InvalidArgumentError].freeze
38
+ EXACTLY_ONCE_DELIVERY_POSSIBLE_RETRIABLE_ERRORS = [Google::Cloud::CanceledError,
39
+ Google::Cloud::DeadlineExceededError,
40
+ Google::Cloud::InternalError,
41
+ Google::Cloud::ResourceExhaustedError,
42
+ Google::Cloud::InvalidArgumentError].freeze
43
43
  MAX_RETRY_DURATION = 600 # 600s since the server allows ack/modacks for 10 mins max
44
44
  MAX_TRIES = 15
45
45
  BASE_INTERVAL = 1
@@ -128,7 +128,7 @@ module Google
128
128
  begin
129
129
  @subscriber.service.acknowledge ack_req.subscription, *ack_req.ack_ids
130
130
  handle_callback AcknowledgeResult.new(AcknowledgeResult::SUCCESS), ack_req.ack_ids
131
- rescue *RETRIABLE_ERRORS => e
131
+ rescue *EXACTLY_ONCE_DELIVERY_POSSIBLE_RETRIABLE_ERRORS => e
132
132
  handle_failure e, ack_req.ack_ids if @subscriber.exactly_once_delivery_enabled
133
133
  rescue StandardError => e
134
134
  handle_callback construct_result(e), ack_req.ack_ids
@@ -146,7 +146,7 @@ module Google
146
146
  handle_callback AcknowledgeResult.new(AcknowledgeResult::SUCCESS),
147
147
  mod_ack_req.ack_ids,
148
148
  modack: true
149
- rescue *RETRIABLE_ERRORS => e
149
+ rescue *EXACTLY_ONCE_DELIVERY_POSSIBLE_RETRIABLE_ERRORS => e
150
150
  if @subscriber.exactly_once_delivery_enabled
151
151
  handle_failure e, mod_ack_req.ack_ids, mod_ack_req.ack_deadline_seconds
152
152
  end
@@ -276,7 +276,7 @@ module Google
276
276
  max_interval: MAX_INTERVAL,
277
277
  multiplier: MULTIPLIER,
278
278
  max_elapsed_time: MAX_RETRY_DURATION,
279
- on: RETRIABLE_ERRORS do
279
+ on: EXACTLY_ONCE_DELIVERY_POSSIBLE_RETRIABLE_ERRORS do
280
280
  return if ack_ids.nil?
281
281
  begin
282
282
  yield ack_ids
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module PubSub
19
- VERSION = "2.12.0".freeze
19
+ VERSION = "2.12.1".freeze
20
20
  end
21
21
 
22
22
  Pubsub = PubSub unless const_defined? :Pubsub
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-pubsub
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.0
4
+ version: 2.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-08-09 00:00:00.000000000 Z
12
+ date: 2022-08-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby