[#109095] [Ruby master Misc#18888] Migrate ruby-lang.org mail services to Google Domains and Google Workspace — "shugo (Shugo Maeda)" <noreply@...>
Issue #18888 has been reported by shugo (Shugo Maeda).
16 messages
2022/06/30
[ruby-core:109100] [Ruby master Bug#17679] Ractor incoming channel can consume unlimited resources
From:
"ivoanjo (Ivo Anjo)" <noreply@...>
Date:
2022-06-30 10:49:21 UTC
List:
ruby-core #109100
Issue #17679 has been updated by ivoanjo (Ivo Anjo).
Thanks @phigrofi for the hint! Definitely looks like an interesting way out of this.
----------------------------------------
Bug #17679: Ractor incoming channel can consume unlimited resources
https://bugs.ruby-lang.org/issues/17679#change-98247
* Author: marcotc (Marco Costa)
* Status: Assigned
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
## Background
In the [ddtrace](https://github.com/DataDog/dd-trace-rb) gem, we want to move telemetry trace sending to a separate background Ractor. We’re concerned that if something goes wrong/gets delayed in this background Ractor, more and more data will accumulate in the send/receive channel until the Ruby VM crashes because it runs out of memory.
## How to reproduce (Ruby version & script)
```ruby
receiver_ractor = Ractor.new do
loop do
message = Ractor.receive
sleep 1
puts "Processed #{message}"
end
end
counter = 0
while true
counter += 1
receiver_ractor.send(counter)
end
```
## Expectation and result
The result is that the Ruby VM crashes due to out of memory.
We expect the Ruby VM to not crash.
## Suggested solutions
Some ideas on how this can be improved:
* Having a way for the sender of data to detect if the receiver Ractor is falling behind (approximate size of queue, timestamp of last processed item, or similar?).
* Having a way to limit the Ractor message receive buffer.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>