[#109115] [Ruby master Misc#18891] Expand tabs in C code — "k0kubun (Takashi Kokubun)" <noreply@...>

Issue #18891 has been reported by k0kubun (Takashi Kokubun).

13 messages 2022/07/02

[#109118] [Ruby master Bug#18893] Don't redefine memcpy(3) — "alx (Alejandro Colomar)" <noreply@...>

Issue #18893 has been reported by alx (Alejandro Colomar).

11 messages 2022/07/02

[#109152] [Ruby master Bug#18899] Inconsistent argument handling in IO#set_encoding — "javanthropus (Jeremy Bopp)" <noreply@...>

Issue #18899 has been reported by javanthropus (Jeremy Bopp).

10 messages 2022/07/06

[#109193] [Ruby master Bug#18909] ARGF.readlines reads more than current file — "JohanJosefsson (Johan Josefsson)" <noreply@...>

Issue #18909 has been reported by JohanJosefsson (Johan Josefsson).

17 messages 2022/07/13

[#109196] [Ruby master Bug#18911] Process._fork hook point is not called when Process.daemon is used — "ivoanjo (Ivo Anjo)" <noreply@...>

Issue #18911 has been reported by ivoanjo (Ivo Anjo).

9 messages 2022/07/13

[#109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta — "hsbt (Hiroshi SHIBATA)" <noreply@...>

Issue #18912 has been reported by hsbt (Hiroshi SHIBATA).

20 messages 2022/07/14

[#109206] [Ruby master Bug#18914] Segmentation fault during Ruby test suite execution — "jprokop (Jarek Prokop)" <noreply@...>

Issue #18914 has been reported by jprokop (Jarek Prokop).

8 messages 2022/07/14

[#109207] [Ruby master Feature#18915] New error class: NotImplementedYetError or scope change for NotImplementedYet — Quintasan <noreply@...>

Issue #18915 has been reported by Quintasan (Michał Zając).

18 messages 2022/07/14

[#109260] [Ruby master Feature#18930] Officially deprecate class variables — "Eregon (Benoit Daloze)" <noreply@...>

Issue #18930 has been reported by Eregon (Benoit Daloze).

21 messages 2022/07/20

[#109314] [Ruby master Bug#18938] Backport cf7d07570f50ef9c16007019afcff11ba6500d70 — "byroot (Jean Boussier)" <noreply@...>

Issue #18938 has been reported by byroot (Jean Boussier).

8 messages 2022/07/25

[#109371] [Ruby master Feature#18949] Deprecate and remove replicate and dummy encodings — "Eregon (Benoit Daloze)" <noreply@...>

Issue #18949 has been reported by Eregon (Benoit Daloze).

35 messages 2022/07/29

[ruby-core:109330] [Ruby master Bug#18940] Ruby Ractor fails with IOError when handling higher concurrency

From: "brodock (Gabriel Mazetto)" <noreply@...>
Date: 2022-07-26 18:33:12 UTC
List: ruby-core #109330
Issue #18940 has been reported by brodock (Gabriel Mazetto).

----------------------------------------
Bug #18940: Ruby Ractor fails with IOError when handling higher concurrency
https://bugs.ruby-lang.org/issues/18940

* Author: brodock (Gabriel Mazetto)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.2.0dev (2022-07-26T16:40:03Z master 3b1ed03d8c) [arm64-darwin21]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Reproduction server:

```
require 'socket'

# Set based on CPU count
CONCURRENCY = 8

server = TCPServer.new(8080)
workers = CONCURRENCY.times.map do
  Ractor.new do
    loop do
      # receive TCPSocket
      session = Ractor.recv

      request = session.gets
      puts request

      session.print "HTTP/1.1 200\r\n"
      session.print "Content-Type: text/html\r\n"
      session.print "\r\n"
      session.print "Hello world! Current time is #{Time.now}"
      session.close
    end
  end
end

loop do
  conn, _ = server.accept

  # pass TCPSocket to one of the workers
  workers.sample.send(conn, move: true)
end
```

run apache benchmark against code above:

```
ab -n 20000 -c 20 http://localhost:8080/
```

or run using hey (https://github.com/rakyll/hey):

```
hey -n 20000 -c 20 http://localhost:8080/
```

you should see something like this on the benchmark tool side:

```
Summary:
  Total:	32.9538 secs
  Slowest:	2.6317 secs
  Fastest:	0.0002 secs
  Average:	0.0331 secs
  Requests/sec:	606.9098


Response time histogram:
  0.000 [1]	|
  0.263 [16968]	|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.527 [1740]	|■■■■
  0.790 [0]	|
  1.053 [0]	|
  1.316 [0]	|
  1.579 [0]	|
  1.842 [0]	|
  2.105 [20]	|
  2.369 [0]	|
  2.632 [6]	|


Latency distribution:
  10% in 0.0008 secs
  25% in 0.0010 secs
  50% in 0.0012 secs
  75% in 0.0016 secs
  90% in 0.0075 secs
  95% in 0.3101 secs
  99% in 0.3175 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0322 secs, 0.0002 secs, 2.6317 secs
  DNS-lookup:	0.0006 secs, 0.0000 secs, 0.0127 secs
  req write:	0.0001 secs, 0.0000 secs, 0.0095 secs
  resp wait:	0.0007 secs, 0.0000 secs, 0.0140 secs
  resp read:	0.0001 secs, 0.0000 secs, 0.0088 secs

Status code distribution:
  [200]	18735 responses

Error distribution:
  [1231]	Get "http://localhost:8080/": dial tcp [::1]:8080: connect: connection refused
  [16]	Get "http://localhost:8080/": dial tcp [::1]:8080: connect: connection reset by peer
  [1]	Get "http://localhost:8080/": net/http: HTTP/1.x transport connection broken: unexpected EOF
  [1]	Get "http://localhost:8080/": read tcp 127.0.0.1:57078->127.0.0.1:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57054->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57058->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57059->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57062->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57067->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57068->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57069->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57070->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57071->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57072->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57075->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57076->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57087->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57088->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57089->[::1]:8080: read: connection reset by peer
  [1]	Get "http://localhost:8080/": read tcp [::1]:57090->[::1]:8080: read: connection reset by peer
```

and this on the ruby process:

```
...

GET / HTTP/1.1
GET / HTTP/1.1
#<Thread:0x0000000100fbf6e8 run> terminated with exception (report_on_exception is true):
ractor.rb:21:in `write': GET / HTTP/1.1
uninitialized stream (IOError)
	from ractor.rb:21:in `print'
	from ractor.rb:21:in `block (3 levels) in <main>'
	from ractor.rb:11:in `loop'
	from ractor.rb:11:in `block (2 levels) in <main>'
GET / HTTP/1.1
GET / HTTP/1.1
```




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next