raindrops 0.20.0 → 0.20.1
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 +4 -4
- data/.manifest +1 -0
- data/GIT-VERSION-FILE +1 -1
- data/GIT-VERSION-GEN +1 -1
- data/LATEST +6 -7
- data/NEWS +9 -0
- data/ext/raindrops/linux_inet_diag.c +2 -2
- data/test/test_linux_reuseport_tcp_listen_stats.rb +51 -0
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee0ff94057cce668ffed3609681f205ef8e54bb4e9a6e941b4791cf81992963d
|
|
4
|
+
data.tar.gz: 258357b6481aa52cae71265529d496fbd264226ed1f3c01ffe5f6c9bed8c5f67
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e4f8a6fedf68bad77b9378044ff6bb2eca2812ad333501ee090b9368f2e8ec6c796f08b076e90be41a7e6f3cf5447d92e0b6fa6f238e6c973a3ca7012e8fd597
|
|
7
|
+
data.tar.gz: '02475783c3a7830dbbf701edf4511f9fae67771ad081a56460082aa9bda0e5e6714a0b0eef2385fbee315e71b28c90259d5c91c16b881df4b3f9a96e0f1ff6e4'
|
data/.manifest
CHANGED
|
@@ -49,6 +49,7 @@ test/test_linux_all_tcp_listen_stats.rb
|
|
|
49
49
|
test/test_linux_all_tcp_listen_stats_leak.rb
|
|
50
50
|
test/test_linux_ipv6.rb
|
|
51
51
|
test/test_linux_middleware.rb
|
|
52
|
+
test/test_linux_reuseport_tcp_listen_stats.rb
|
|
52
53
|
test/test_middleware.rb
|
|
53
54
|
test/test_middleware_unicorn.rb
|
|
54
55
|
test/test_middleware_unicorn_ipv6.rb
|
data/GIT-VERSION-FILE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
GIT_VERSION = 0.20.
|
|
1
|
+
GIT_VERSION = 0.20.1
|
data/GIT-VERSION-GEN
CHANGED
data/LATEST
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
=== raindrops 0.20.
|
|
1
|
+
=== raindrops 0.20.1 / 2023-02-25 00:19 UTC
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Stats for SO_REUSEPORT sockets are now handled properly.
|
|
4
|
+
Thanks to Dale Hamel for the patches.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
available via IMAP(S).
|
|
6
|
+
Dale Hamel (2):
|
|
7
|
+
Fix queue stats for sockets with SO_REUSEPORT
|
|
8
|
+
Fix off by one error in test
|
|
10
9
|
|
data/NEWS
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
=== raindrops 0.20.1 / 2023-02-25 00:19 UTC
|
|
2
|
+
|
|
3
|
+
Stats for SO_REUSEPORT sockets are now handled properly.
|
|
4
|
+
Thanks to Dale Hamel for the patches.
|
|
5
|
+
|
|
6
|
+
Dale Hamel (2):
|
|
7
|
+
Fix queue stats for sockets with SO_REUSEPORT
|
|
8
|
+
Fix off by one error in test
|
|
9
|
+
|
|
1
10
|
=== raindrops 0.20.0 / 2021-12-06 23:41 UTC
|
|
2
11
|
|
|
3
12
|
Raindrops may now use file-backed mmap() rather than anonymous
|
|
@@ -306,7 +306,7 @@ static void table_set_queued(st_table *table, struct inet_diag_msg *r)
|
|
|
306
306
|
{
|
|
307
307
|
struct listen_stats *stats = stats_for(table, r);
|
|
308
308
|
stats->listener_p = 1;
|
|
309
|
-
stats->queued
|
|
309
|
+
stats->queued += r->idiag_rqueue;
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
/* inner loop of inet_diag, called for every socket returned by netlink */
|
|
@@ -328,7 +328,7 @@ static inline void r_acc(struct nogvl_args *args, struct inet_diag_msg *r)
|
|
|
328
328
|
if (args->table)
|
|
329
329
|
table_set_queued(args->table, r);
|
|
330
330
|
else
|
|
331
|
-
args->stats.queued
|
|
331
|
+
args->stats.queued += r->idiag_rqueue;
|
|
332
332
|
}
|
|
333
333
|
/*
|
|
334
334
|
* we wont get anything else because of the idiag_states filter
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# -*- encoding: binary -*-
|
|
2
|
+
require "./test/rack_unicorn"
|
|
3
|
+
require 'test/unit'
|
|
4
|
+
require 'socket'
|
|
5
|
+
require 'raindrops'
|
|
6
|
+
$stderr.sync = $stdout.sync = true
|
|
7
|
+
|
|
8
|
+
class TestLinuxReuseportTcpListenStats < Test::Unit::TestCase
|
|
9
|
+
include Raindrops::Linux
|
|
10
|
+
include Unicorn::SocketHelper
|
|
11
|
+
TEST_ADDR = ENV['UNICORN_TEST_ADDR'] || '127.0.0.1'
|
|
12
|
+
DEFAULT_BACKLOG = 10
|
|
13
|
+
|
|
14
|
+
def setup
|
|
15
|
+
@socks = []
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def teardown
|
|
19
|
+
@socks.each { |io| io.closed? or io.close }
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def new_socket_server(**kwargs)
|
|
23
|
+
s = new_tcp_server TEST_ADDR, kwargs[:port] || 0, kwargs
|
|
24
|
+
s.listen(kwargs[:backlog] || DEFAULT_BACKLOG)
|
|
25
|
+
@socks << s
|
|
26
|
+
[ s, s.addr[1] ]
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def new_client(port)
|
|
30
|
+
s = TCPSocket.new("127.0.0.1", port)
|
|
31
|
+
@socks << s
|
|
32
|
+
s
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def test_reuseport_queue_stats
|
|
36
|
+
listeners = 10
|
|
37
|
+
_, port = new_socket_server(reuseport: true)
|
|
38
|
+
addr = "#{TEST_ADDR}:#{port}"
|
|
39
|
+
(listeners - 1).times do
|
|
40
|
+
new_socket_server(reuseport: true, port: port)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
listeners.times do |i|
|
|
44
|
+
all = Raindrops::Linux.tcp_listener_stats
|
|
45
|
+
assert_equal [0, i], all[addr].to_a
|
|
46
|
+
new_client(port)
|
|
47
|
+
all = Raindrops::Linux.tcp_listener_stats
|
|
48
|
+
assert_equal [0, i+1], all[addr].to_a
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end if RUBY_PLATFORM =~ /linux/
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: raindrops
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.20.
|
|
4
|
+
version: 0.20.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- raindrops hackers
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-02-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aggregate
|
|
@@ -141,6 +141,7 @@ files:
|
|
|
141
141
|
- test/test_linux_all_tcp_listen_stats_leak.rb
|
|
142
142
|
- test/test_linux_ipv6.rb
|
|
143
143
|
- test/test_linux_middleware.rb
|
|
144
|
+
- test/test_linux_reuseport_tcp_listen_stats.rb
|
|
144
145
|
- test/test_middleware.rb
|
|
145
146
|
- test/test_middleware_unicorn.rb
|
|
146
147
|
- test/test_middleware_unicorn_ipv6.rb
|
|
@@ -168,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
168
169
|
- !ruby/object:Gem::Version
|
|
169
170
|
version: '0'
|
|
170
171
|
requirements: []
|
|
171
|
-
rubygems_version: 3.
|
|
172
|
+
rubygems_version: 3.4.1
|
|
172
173
|
signing_key:
|
|
173
174
|
specification_version: 4
|
|
174
175
|
summary: real-time stats for preforking Rack servers
|
|
@@ -181,6 +182,7 @@ test_files:
|
|
|
181
182
|
- test/test_linux_all_tcp_listen_stats_leak.rb
|
|
182
183
|
- test/test_linux_ipv6.rb
|
|
183
184
|
- test/test_linux_middleware.rb
|
|
185
|
+
- test/test_linux_reuseport_tcp_listen_stats.rb
|
|
184
186
|
- test/test_middleware.rb
|
|
185
187
|
- test/test_middleware_unicorn.rb
|
|
186
188
|
- test/test_middleware_unicorn_ipv6.rb
|