google-cloud-pubsub 2.15.2 → 2.15.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/google/cloud/pubsub/subscriber/stream.rb +24 -6
- data/lib/google/cloud/pubsub/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b87b7780f67e6085a5385cead0cef00b28a2648838f62127077354e4a0f16ce9
|
4
|
+
data.tar.gz: c78f13b82c1482b32a71988acf62d76a9829806cdfcdfa5bff952764438c06f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be588f7f62da5e5e318674c40e1009e742120444e972fad475727936027b336801f2b8ae460be36c68d5912052d1fe5a577a100617aef31298d7d8312c6a000c
|
7
|
+
data.tar.gz: d79918f0b74eaaf5c393b72231e2d4162536ac0f18c8ac6eb8893d1b49dd0a68fd20e3c6ee8efcd5879a9b0aa7543948ce4c55d1532f58c7939d654b8b579dd1
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 2.15.3 (2023-04-19)
|
4
|
+
|
5
|
+
#### Bug Fixes
|
6
|
+
|
7
|
+
* wait for successful receipt modack when exactly once delivery enabled ([#21431](https://github.com/googleapis/google-cloud-ruby/issues/21431))
|
8
|
+
|
3
9
|
### 2.15.2 (2023-03-19)
|
4
10
|
|
5
11
|
#### Bug Fixes
|
@@ -248,6 +248,7 @@ module Google
|
|
248
248
|
# Cannot syncronize the enumerator, causes deadlock
|
249
249
|
response = enum.next
|
250
250
|
new_exactly_once_delivery_enabled = response&.subscription_properties&.exactly_once_delivery_enabled
|
251
|
+
received_messages = response.received_messages
|
251
252
|
|
252
253
|
# Use synchronize so changes happen atomically
|
253
254
|
synchronize do
|
@@ -256,17 +257,21 @@ module Google
|
|
256
257
|
@subscriber.exactly_once_delivery_enabled = @exactly_once_delivery_enabled
|
257
258
|
|
258
259
|
# Create receipt of received messages reception
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
260
|
+
if @exactly_once_delivery_enabled
|
261
|
+
create_receipt_modack_for_eos received_messages
|
262
|
+
else
|
263
|
+
@subscriber.buffer.modify_ack_deadline @subscriber.deadline, received_messages.map(&:ack_id)
|
264
|
+
# Add received messages to inventory
|
265
|
+
@inventory.add received_messages
|
266
|
+
end
|
263
267
|
end
|
264
268
|
|
265
|
-
|
269
|
+
received_messages.each do |rec_msg_grpc|
|
266
270
|
rec_msg = ReceivedMessage.from_grpc(rec_msg_grpc, self)
|
267
271
|
# No need to synchronize the callback future
|
268
272
|
register_callback rec_msg
|
269
|
-
end
|
273
|
+
end if !@exactly_once_delivery_enabled # Exactly once delivery scenario is handled by callback
|
274
|
+
|
270
275
|
synchronize { pause_streaming! }
|
271
276
|
rescue StopIteration
|
272
277
|
break
|
@@ -295,6 +300,19 @@ module Google
|
|
295
300
|
|
296
301
|
# rubocop:enable all
|
297
302
|
|
303
|
+
def create_receipt_modack_for_eos received_messages
|
304
|
+
received_messages.each do |rec_msg_grpc|
|
305
|
+
callback = proc do |result|
|
306
|
+
if result.succeeded?
|
307
|
+
synchronize { @inventory.add rec_msg_grpc }
|
308
|
+
rec_msg = ReceivedMessage.from_grpc rec_msg_grpc, self
|
309
|
+
register_callback rec_msg
|
310
|
+
end
|
311
|
+
end
|
312
|
+
@subscriber.buffer.modify_ack_deadline @subscriber.deadline, [rec_msg_grpc.ack_id], callback
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
298
316
|
# Updates min_duration_per_lease_extension to 60 when exactly_once_delivery_enabled
|
299
317
|
# and reverts back to default 0 when disabled.
|
300
318
|
# Skips if exactly_once_enabled is not modified.
|
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.15.
|
4
|
+
version: 2.15.3
|
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: 2023-
|
12
|
+
date: 2023-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: concurrent-ruby
|