polyphony 0.49.0 → 0.49.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 444ffbf8eb00cbd5e6948d6e3347e244fb8ea548aa1ad302d266e2f16c1a91b9
4
- data.tar.gz: 2ac2f6ba1b51e71f1f138ad8eae665cc12e5458e836a0ef4f2df30d9ab95b679
3
+ metadata.gz: 4d455bffada65a186f47a33dec9a29bf81a8a025b4c536a0d3136e256a3aaa55
4
+ data.tar.gz: '094f9bae247c640ac2ea721625b5dd4b58ae4943186bfc015c9c830117a9dbee'
5
5
  SHA512:
6
- metadata.gz: 65924d13d191fc7c6d7b9fc2f7df997218396cf7ff9933564296ee50100441279387b01dc046797378973514dc45b25afd7eda92e19aac9dde3d7f2a13a9901e
7
- data.tar.gz: a419d45a69c4a12a468277068ed792cc82d0384b2d620497c4c132fa27b9155ce05ce6662c062766ae5204c8c09a490bb1e95164c7a4bf0baa9f3166ac57d348
6
+ metadata.gz: e8a462663b9e1bca1f99b301c8d904b5fad091851dff9cf5af785bf3a76802ddeb5904565b4a79e916b8a4b97001181a48bed7a56dadf1143dfc11d9ae7762d2
7
+ data.tar.gz: 68765d941201a2d74ae1e8cc20a9ea3c6fba9e68b6a552dc65a399a7ad8853a619a259ebc1dc705cdb2f3eae77adee4098de1186212755f7d87064bbaaf125f8
@@ -1,3 +1,9 @@
1
+ ## 0.49.1
2
+
3
+ - Use `TCPSocket` instead of `Socket` in `Net.tcp_connect`
4
+ - Catch `Errno::ERSCH` in `Process.kill_and_await`
5
+ - Set io_uring queue size to 2048
6
+
1
7
  ## 0.49.0
2
8
 
3
9
  - Implement `Polyphony::Timer` for performant timeouts
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- polyphony (0.49.0)
4
+ polyphony (0.49.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/TODO.md CHANGED
@@ -1,6 +1,7 @@
1
- - Check segfault when doing lots of `cancel_after` calls
1
+ - Check segfault when resetting a `cancel_after` timeout lots of times at very high rate
2
+ - Check why `throttled_loop` inside of `move_on_after` fails to stop
2
3
 
3
- - Override stock `SizedQueue` impl with Queue with capacity
4
+ - Override stock `::SizedQueue` impl with Queue with capacity
4
5
 
5
6
  - Add support for `break` and `StopIteration` in all loops (with tests)
6
7
 
@@ -72,7 +72,7 @@ static VALUE Backend_initialize(VALUE self) {
72
72
  backend->pending_count = 0;
73
73
  backend->poll_no_wait_count = 0;
74
74
  backend->pending_sqes = 0;
75
- backend->prepared_limit = 256;
75
+ backend->prepared_limit = 2048;
76
76
 
77
77
  context_store_initialize(&backend->store);
78
78
  io_uring_queue_init(backend->prepared_limit, &backend->ring, 0);
@@ -44,7 +44,7 @@ module Polyphony
44
44
  rescue SystemExit
45
45
  # fall through to ensure
46
46
  rescue Exception => e
47
- warn e.full_message
47
+ STDERR << e.full_message
48
48
  exit!
49
49
  ensure
50
50
  exit_forked_process
@@ -24,6 +24,8 @@ module Polyphony
24
24
  def kill_and_await(sig, pid)
25
25
  ::Process.kill(sig, pid)
26
26
  Thread.current.backend.waitpid(pid)
27
+ rescue Errno::ERSCH
28
+ # ignore
27
29
  end
28
30
  end
29
31
  end
@@ -8,10 +8,7 @@ module Polyphony
8
8
  module Net
9
9
  class << self
10
10
  def tcp_connect(host, port, opts = {})
11
- socket = ::Socket.new(:INET, :STREAM).tap do |s|
12
- addr = ::Socket.sockaddr_in(port, host)
13
- s.connect(addr)
14
- end
11
+ socket = TCPSocket.new(host, port)
15
12
  if opts[:secure_context] || opts[:secure]
16
13
  secure_socket(socket, opts[:secure_context], opts.merge(host: host))
17
14
  else
@@ -23,7 +20,7 @@ module Polyphony
23
20
  host ||= '0.0.0.0'
24
21
  raise 'Port number not specified' unless port
25
22
 
26
- socket = socket_from_options(host, port, opts)
23
+ socket = listening_socket_from_options(host, port, opts)
27
24
  if opts[:secure_context] || opts[:secure]
28
25
  secure_server(socket, opts[:secure_context], opts)
29
26
  else
@@ -31,7 +28,7 @@ module Polyphony
31
28
  end
32
29
  end
33
30
 
34
- def socket_from_options(host, port, opts)
31
+ def listening_socket_from_options(host, port, opts)
35
32
  ::Socket.new(:INET, :STREAM).tap do |s|
36
33
  s.reuse_addr if opts[:reuse_addr]
37
34
  s.dont_linger if opts[:dont_linger]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polyphony
4
- VERSION = '0.49.0'
4
+ VERSION = '0.49.1'
5
5
  end
@@ -31,13 +31,15 @@ class TimerMoveOnAfterTest < MiniTest::Test
31
31
  end
32
32
  t1 = Time.now
33
33
 
34
- assert_in_range 0.01..0.02, t1 - t0
34
+ assert_in_range 0.01..0.025, t1 - t0
35
35
  assert_equal :bar, v
36
36
  end
37
37
 
38
38
  def test_move_on_after_with_reset
39
39
  t0 = Time.now
40
40
  v = @timer.move_on_after(0.01, with_value: :moved_on) do
41
+ sleep 0.007
42
+ @timer.reset
41
43
  sleep 0.007
42
44
  @timer.reset
43
45
  sleep 0.007
@@ -46,11 +48,11 @@ class TimerMoveOnAfterTest < MiniTest::Test
46
48
  t1 = Time.now
47
49
 
48
50
  assert_nil v
49
- assert_in_range 0.014..0.02, t1 - t0
51
+ assert_in_range 0.02..0.03, t1 - t0
50
52
  end
51
53
  end
52
54
 
53
- class CancelAfterTest < MiniTest::Test
55
+ class TimerCancelAfterTest < MiniTest::Test
54
56
  def setup
55
57
  @timer = Polyphony::Timer.new(resolution: 0.01)
56
58
  end
@@ -69,7 +71,7 @@ class CancelAfterTest < MiniTest::Test
69
71
  end
70
72
  end
71
73
  t1 = Time.now
72
- assert_in_range 0.01..0.02, t1 - t0
74
+ assert_in_range 0.01..0.03, t1 - t0
73
75
  end
74
76
 
75
77
  def test_cancel_after_with_reset
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyphony
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.49.0
4
+ version: 0.49.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-11 00:00:00.000000000 Z
11
+ date: 2021-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler