omq 0.16.1 → 0.16.2

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: f74ea96d0fc94d40c2d5ac0dd815e112a8fc8af8f74d5b932799fb19981c58b5
4
- data.tar.gz: f79ddfe0a3519f7011353c03eeb18f054e9c5384e3e67250db699179c86be96e
3
+ metadata.gz: 856ca133b440ec0812ec17c9a470ce25d69a405f0d3fdbedb04194a4ac60527e
4
+ data.tar.gz: 8b01aceb4098b436ad0c69f0c62930d6fafe8372bf6cbc77004cb4569936c6be
5
5
  SHA512:
6
- metadata.gz: 6ef57ca7cfd08b2add9adc5dc501a1a587b29ddb534ca55b20d1bf8cebf3571538c79cfc7ed1e1d2cddf93b69993b9f674c951cf37d32be54c93550465f00dca
7
- data.tar.gz: 5d847021b68bed1f6b93d128afdc455c2354c8dc11febf8a711624c5559d4d03786a041db2b0d797b4518a789971029f9db8b6ad94becf44ae807a14ae396cf2
6
+ metadata.gz: 7b08a46d592cc3ba300991aaab8b99cbb22c377520b10bee9a8e67537d714474707113b15e8202a3f3b5bf277d8796b8ff0670f63e6cb850721d4a18374aac2b
7
+ data.tar.gz: 7cb4caa364be3a387f4aaa531b4019fa075d434b2d243507892cc7ae6dbe13f0b9b2c201564f703ff4fc5ed42b27f714753ae870c4fcd9af47ab102afdcb3bf3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.16.2 — 2026-04-09
4
+
5
+ ### Fixed
6
+
7
+ - **Work-stealing send pump fairness.** `RoundRobin#start_conn_send_pump`
8
+ had no fiber yield between batches. `write_batch` typically completes
9
+ without yielding when the kernel TCP buffer absorbs the whole batch,
10
+ so the first pump to wake could drain a pre-filled send queue in one
11
+ continuous run — starving peer pumps until the queue was empty. This
12
+ was visible as a flaky `push_pull_test.rb#test_0002 distributes
13
+ messages across multiple PULL peers` on CI, where the second peer
14
+ received zero messages. Added `Async::Task.current.yield` at the
15
+ bottom of the pump loop; effectively free when there is no other
16
+ work, and guarantees peers actually get a turn when the queue stays
17
+ non-empty.
18
+
19
+ - **`disconnect` test no longer assumes strict round-robin.** The test
20
+ asserted that `push.send("to ep1")` followed by `pull1.receive`
21
+ returns that exact message — only true with libzmq-style strict
22
+ per-peer round-robin, not OMQ's work-stealing. It was passing by
23
+ accident because the first-started pump consistently dequeued first.
24
+ Rewritten to only assert the actual `#disconnect` semantics: after
25
+ `disconnect("ep1")`, subsequent messages reach ep2 and ep1 receives
26
+ nothing.
27
+
3
28
  ## 0.16.1 — 2026-04-09
4
29
 
5
30
  ### Changed
@@ -112,6 +112,13 @@ module OMQ
112
112
  # per-pump latency bounded enough that small-message multi-peer
113
113
  # fairness still benefits.
114
114
  #
115
+ # A `Task.yield` between batches ensures peer pumps actually
116
+ # get a turn: `write_batch` may complete without yielding when
117
+ # TCP buffers absorb the whole batch, so without this the first
118
+ # pump to wake can drain a pre-filled queue in one continuous
119
+ # run. The yield is effectively free when the scheduler has no
120
+ # other work.
121
+ #
115
122
  # @param conn [Connection]
116
123
  #
117
124
  def start_conn_send_pump(conn)
@@ -121,6 +128,7 @@ module OMQ
121
128
  drain_send_queue_capped(batch)
122
129
  write_batch(conn, batch)
123
130
  batch.each { |parts| @engine.emit_verbose_monitor_event(:message_sent, parts: parts) }
131
+ Async::Task.current.yield
124
132
  rescue Protocol::ZMTP::Error, *CONNECTION_LOST
125
133
  @engine.connection_lost(conn)
126
134
  break
data/lib/omq/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OMQ
4
- VERSION = "0.16.1"
4
+ VERSION = "0.16.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.1
4
+ version: 0.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Wenger