| Age | Commit message (Collapse) | Author |
|
Issue - https://bugs.ruby-lang.org/issues/21436
Apparently, the lower bound check is missing, which results in overflow & wrapping later on in RB_INT2FIX
Signed-off-by: Dmitry Dygalo <dmitry.dygalo@workato.com>
https://github.com/ruby/date/commit/67d75e8423
|
|
Addresses https://bugs.ruby-lang.org/issues/21437
Signed-off-by: Dmitry Dygalo <dmitry.dygalo@workato.com>
https://github.com/ruby/date/commit/31f07bc576
|
|
|
|
Using an enumerator does not resolve the intermittent failures: 100+
failures in 10,000 iterations.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11987
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11987
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13617
|
|
[Bug #21438]
Previously GC could trigger a table rebuild of the generic fields
st_table in the middle of calling the st_update callback. This could
cause entries to be reallocated or rearranged and the update to be for
the wrong entry.
This commit adds an assertion to make that case easier to detect, and
replaces the st_update with a separate st_lookup and st_insert.
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/13589
|
|
This test was written for another implementation of `#object_id`
which had complex interations with GC, that's not the case of
the implementation that was actually merged.
|
|
* Add `open_timeout` as an overall timeout option for `Socket.tcp`
[Background]
Currently, `TCPSocket.new` and `Socket.tcp` accept two kind of timeout options:
- `resolv_timeout`, which controls the timeout for DNS resolution
- `connect_timeout`, which controls the timeout for the connection attempt
With the introduction of Happy Eyeballs Version 2 (as per [RFC 8305](https://datatracker.ietf.org/doc/html/rfc8305)) in[ Feature #20108](https://bugs.ruby-lang.org/issues/20108) and [Feature #20782](https://bugs.ruby-lang.org/issues/20782), both address resolution and connection attempts are now parallelized.
As a result, the sum of `resolv_timeout` and `connect_timeout` no longer represents the total timeout duration. This is because, in HEv2, name resolution and connection attempts are performed concurrently, causing the two timeouts to overlap.
Example:
When `resolv_timeout: 200ms` and `connect_timeout: 100ms` are set:
1. An IPv6 address is resolved after the method starts immediately (IPv4 is still being resolved).
2. A connection attempt is initiated to the IPv6 address
3. After 100ms, `connect_timeout` is exceeded. However, since `resolv_timeout` still has 100ms left, the IPv4 resolution continues.
4. After 200ms from the start, the method raises a `resolv_timeout` error.
In this case, the total elapsed time before a timeout is 200ms, not the expected 300ms (100ms + 200ms).
Furthermore, in HEv2, connection attempts are also parallelized.
It starts a new connection attempts every 250ms for resolved addresses. This makes the definition of `connect_timeout` even more ambiguous—specifically, it becomes unclear from which point the timeout is counted.
Additionally, these methods initiate new connection attempts every 250ms (Connection Attempt Delay) for each candidate address, thereby parallelizing connection attempts. However, this behavior makes it unclear from which point in time the connect_timeout is actually measured.
Currently, a `connect_timeout` is raised only after the last connection attempt exceeds the timeout.
Example:
When `connect_timeout: 100ms` is set and 3 address candidates:
1. Start a connection attempt to the address `a`
2. 250ms after step 1, start a new connection attempt to the address `b`
3. 500ms after step 1, start a new connection attempt to the address `c`
4. 1000ms after step 3 (1000ms after starting the connection to `c`, 1250ms after starting the connection to `b,` and 1500ms after starting the connection to `a`) `connect_timeout` is raised
This behavior aims to favor successful connections by allowing more time for each attempt, but it results in a timeout model that is difficult to reason about.
These methods have supported `resolv_timeout` and `connect_timeout` options even before the introduction of HEv2. However, in many use cases, it would be more convenient if a timeout occurred after a specified duration from the start of the method. Similar functions in other languages (such as PHP, Python, and Go) typically allow specifying only an overall timeout.
[Proposal]
I propose adding an `open_timeout` option to `Socket.tcp` in this PR, which triggers a timeout after a specified duration has elapsed from the start of the method.
The name `open_timeout` aligns with the existing accessor used in `Net::HTTP`.
If `open_timeout` is specified together with `resolv_timeout` and `connect_timeout`, I propose that only `open_timeout` be used and the others be ignored. While it is possible to support combinations of `open_timeout`, `resolv_timeout`, and `connect_timeout`, doing so would require defining which timeout takes precedence in which situations. In this case, I believe it is more valuable to keep the behavior simple and easy to understand, rather than supporting more complex use cases.
If this proposal is accepted, I also plan to extend `open_timeout` support to `TCPSocket.new`.
While the long-term future of `resolv_timeout` and `connect_timeout` may warrant further discussion, I believe the immediate priority is to offer a straightforward way to specify an overall timeout.
[Outcome]
If `open_timeout` is also supported by `TCPSocket.new`, users would be able to manage total connection timeouts directly in `Net::HTTP#connect` without relying on `Timeout.timeout`.
https://github.com/ruby/ruby/blob/aa0f689bf45352c4a592e7f1a044912c40435266/lib/net/http.rb#L1657
---
* Raise an exception if it is specified together with other timeout options
> If open_timeout is specified together with resolv_timeout and connect_timeout, I propose that only open_timeout be used and the others be ignored.
Since this approach may be unclear to users, I’ve decided to explicitly raise an `ArgumentError` if these options are specified together.
* Add doc
* Fix: open_timeout error should be raised even if there are still addresses that have not been tried
Notes:
Merged-By: shioimm <shioi.mm@gmail.com>
|
|
If an object is shareable and has no capacity left, it isn't
safe to store the object ID in fields as it requires an object
resize which can't be done unless all field reads are synchronized.
In this very specific case we create the object_id in advance,
before the object is made shareable.
Notes:
Merged: https://github.com/ruby/ruby/pull/13609
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13611
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13603
|
|
Co-authored-by: Max Bernstein <tekknolagi@gmail.com>
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13531
|
|
[Bug #21439] Fix PM_SPLAT_NODE compilation error in for loops
This commit fixes a crash that occurred when using splat nodes (*) as
the index variable in for loops. The error "Unexpected node type for
index in for node: PM_SPLAT_NODE" was thrown because the compiler
didn't know how to handle splat nodes in this context.
The fix allows code like `for *x in [[1,2], [3,4]]` to compile and
execute correctly, where the splat collects each sub-array.
Notes:
Merged-By: eileencodes <eileencodes@gmail.com>
|
|
Now that class fields have been deletated to a T_IMEMO/class_fields
when we're in multi-ractor mode, we can read and write class instance
variable in an atomic way using Read-Copy-Update (RCU).
Note when in multi-ractor mode, we always use RCU. In theory
we don't need to, instead if we ensured the field is written
before the shape is updated it would be safe.
Benchmark:
```ruby
Warning[:experimental] = false
class Foo
@foo = 1
@bar = 2
@baz = 3
@egg = 4
@spam = 5
class << self
attr_reader :foo, :bar, :baz, :egg, :spam
end
end
ractors = 8.times.map do
Ractor.new do
1_000_000.times do
Foo.bar + Foo.baz * Foo.egg - Foo.spam
end
end
end
if Ractor.method_defined?(:value)
ractors.each(&:value)
else
ractors.each(&:take)
end
```
This branch vs Ruby 3.4:
```bash
$ hyperfine -w 1 'ruby --disable-all ../test.rb' './miniruby ../test.rb'
Benchmark 1: ruby --disable-all ../test.rb
Time (mean ± σ): 3.162 s ± 0.071 s [User: 2.783 s, System: 10.809 s]
Range (min … max): 3.093 s … 3.337 s 10 runs
Benchmark 2: ./miniruby ../test.rb
Time (mean ± σ): 208.7 ms ± 4.6 ms [User: 889.7 ms, System: 6.9 ms]
Range (min … max): 202.8 ms … 222.0 ms 14 runs
Summary
./miniruby ../test.rb ran
15.15 ± 0.47 times faster than ruby --disable-all ../test.rb
```
Notes:
Merged: https://github.com/ruby/ruby/pull/13594
|
|
Now that classes fields are delegated to an object with its own
shape_id, we no longer need to mark all classes as TOO_COMPLEX.
Notes:
Merged: https://github.com/ruby/ruby/pull/13595
|
|
```
" = note: some arguments are omitted. use `--verbose` to show all linker arguments\n" +
" = note: error: unexpected argument '-W' found\n" +
" \n" +
" tip: to pass '-W' as a value, use '-- -W'\n" +
" \n" +
" Usage: sccache [OPTIONS] <--dist-auth|--debug-preprocessor-cache|--dist-status|--show-stats|--show-adv-stats|--start-server|--stop-server|--zero-stats|--package-toolchain <EXE> <OUT>|CMD>\n" +
" \n" +
" For more information, try '--help'.\n" +
" \n" +
```
https://github.com/rubygems/rubygems/commit/45e688ae62
|
|
Instead, prefer `scan_byte` over `get_byte` since that already returns the byte as an integer, sidestepping conversion issues.
Fixes https://github.com/ruby/prism/issues/3582
https://github.com/ruby/prism/commit/7f3008b2b5
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13581
|
|
I changed content-type of request to "application/octet-stream" if request didn't have
content-type.
https://github.com/ruby/net-http/commit/fc5870d2ac
|
|
If `gem pristine foo` is run, and there's a default copy of foo, only
executables for it are reset. However, that was causing other copies of
`foo` to only reset executables, which is unexpected.
We should not modify `options[:only_executables]`, but respect its value
for every gem, and make sure special handling for default gems does not
leak to other gems.
https://github.com/rubygems/rubygems/commit/2c3039f1b0
|
|
https://github.com/rubygems/rubygems/commit/a61cc97cd4
|
|
in gem install
Instead of picking essentially a random matching platform
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>
https://github.com/rubygems/rubygems/commit/3727096297
|
|
When we copy the table from one set to another we need to run write
barriers.
Notes:
Merged: https://github.com/ruby/ruby/pull/13558
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13549
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13549
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13549
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13549
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13549
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13549
|
|
Make Kernel#inspect ask which instance variables should be dumped by
the result of `#instance_variables_to_inspect`.
Co-Authored-By: Jean Boussier <byroot@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/13555
|
|
On a high load machine, the following test can fail.
This patch simply records the load average with `uptime`.
```
1) Failure:
TestThreadQueue#test_thr_kill [/tmp/ruby/src/trunk_gcc10/test/ruby/test_thread_queue.rb:239]:
only 165/250 done in 60 seconds.
```
|
|
I can reproduce timeout failure with the high load machine:
```
$ RUBY_MAX_CPU=100 ruby -e '100.times{Ractor.new{loop{}}}; sleep' &
$ while make test-all -o exts -o encs TESTS='ruby/gc -n /test_interrupt_in_finalizer/ --repeat-count=100'; do date; done
....
Finished(93/100) tests in 0.653434s, 1.5304 tests/s, 7.6519 assertions/s.
Finished(94/100) tests in 0.614422s, 1.6275 tests/s, 8.1377 assertions/s.
[1/1] TestGc#test_interrupt_in_finalizer = 11.08 s
1) Timeout:
TestGc#test_interrupt_in_finalizer
```
|
|
Now that we have the `heap_index` in shape flags we no longer
need `T_OBJECT` shapes.
Notes:
Merged: https://github.com/ruby/ruby/pull/13556
|
|
This is preparation to getting rid of `T_OBJECT` transitions.
By first only replicating the information it's easier to ensure
consistency.
Notes:
Merged: https://github.com/ruby/ruby/pull/13556
|
|
This helps with getting with of `SHAPE_T_OBJECT`, by ensuring
that transitions will have capacities that match the next embed size.
Notes:
Merged: https://github.com/ruby/ruby/pull/13548
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13527
|
|
I didn't know `rb_ivar_get` existed until @Xrxr pointed me to it.
Thanks, Alan!
Notes:
Merged: https://github.com/ruby/ruby/pull/13527
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13437
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13437
|
|
Pick https://github.com/ruby/openssl/pull/896
|
|
This will help centralize wheel platform selection logic eventually
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
* ZJIT: Pass self through basic block params
Co-authored-by: Max Bernstein <tekknolagi@gmail.com>
* Add comments for self
* Use self_param for ivar
* Make self_param a loop local
* Fix rest parameter type check
* Push self_param first
* Add a test case for putself
* Use SELF_PARAM_IDX
Co-authored-by: Max Bernstein <tekknolagi@gmail.com>
* Fix test_unknown
---------
Co-authored-by: Max Bernstein <tekknolagi@gmail.com>
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13524
|
|
To debug flaky failures on i686 that look like:
1) Failure:
TestGc#test_heaps_grow_independently [test/ruby/test_gc.rb:704]:
Expected 2061929 to be < 2000000.
Notes:
Merged: https://github.com/ruby/ruby/pull/13140
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13470
Merged-By: XrXr
|
|
And adapt release scripts and configuration to the new structure.
https://github.com/rubygems/rubygems/commit/3deb1aedae
|