Description of problem: Package rubygem-pg fails to build from source in Fedora Rawhide. Version-Release number of selected component (if applicable): 1.5.7-1.fc41 Steps to Reproduce: koji build --scratch f42 rubygem-pg-1.5.7-1.fc41.src.rpm Additional info: This package is tracked by Koschei. See: https://koschei.fedoraproject.org/package/rubygem-pg Reproducible: Always Note that it fails everywhere from f39 to Rawhide. It also started to fail in roughly the same time frame. The only difference I can spot is actually the Kernel (!!!). I have also experimentally confirmed that the package fails to build with kernel-6.11.5-100.fc39.x86_64 while works just fine with kernel-6.9.7-100.fc39.x86_64. I'll try to narrow the specific Kernel.
According to my investigation, everything works fine up to kernel-6.9.12-100.fc39.x86_64. Then with `kernel-6.10.0-64.fc41.x86_64` (not that the first f39 version was kernel-6.10.3-100.fc39, which provides the same results), the problem begins: ~~~ Failures: 1) with a Fiber scheduler can send lots of data per put_copy_data Failure/Error: run_with_scheduler(60) do |conn| conn.exec <<-EOSQL CREATE TEMP TABLE copytable (col1 TEXT); EOSQL res = nil conn.copy_data( "COPY copytable FROM STDOUT CSV" ) do data = "x" * 1000 * 1000 data << "\n" 50.times do RuntimeError: scheduler timeout in: /builddir/build/BUILD/spec/helpers/scheduler.rb:57:in `select' /builddir/build/BUILD/spec/helpers/scheduler.rb:57:in `run' /builddir/build/BUILD/spec/helpers/scheduler.rb:130:in `close' /builddir/build/BUILD/spec/helpers/scheduler.rb:114:in `scheduler_close' # /builddir/build/BUILD/spec/helpers.rb:620:in `thread_with_timeout' # /builddir/build/BUILD/spec/helpers.rb:625:in `run_with_scheduler' # ./spec/pg/scheduler_spec.rb:153:in `block (2 levels) in <top (required)>' # /builddir/build/BUILD/spec/helpers.rb:56:in `block in included' Finished in 1 minute 48.55 seconds (files took 0.63329 seconds to load) 983 examples, 1 failure, 2 pending ~~~ I'll keep analyzing, because there are actually 3 failures currently with kernel-6.11.5-100.fc39.x86_64, so the thing progressed.
Starting with kernel-6.10.6-100.fc39.x86_64, there are mostly 2 failures (sometimes only 1): ~~~ 1) with a Fiber scheduler waits when sending query data Failure/Error: run_with_scheduler do |conn| data = "x" * 1000 * 1000 * 10 res = conn.exec_params("SELECT LENGTH($1)", [data]) expect(res.values).to eq([[data.length.to_s]]) end RuntimeError: scheduler timeout in: /builddir/build/BUILD/spec/helpers/scheduler.rb:57:in `select' /builddir/build/BUILD/spec/helpers/scheduler.rb:57:in `run' /builddir/build/BUILD/spec/helpers/scheduler.rb:130:in `close' /builddir/build/BUILD/spec/helpers/scheduler.rb:114:in `scheduler_close' # /builddir/build/BUILD/spec/helpers.rb:620:in `thread_with_timeout' # /builddir/build/BUILD/spec/helpers.rb:625:in `run_with_scheduler' # ./spec/pg/scheduler_spec.rb:43:in `block (2 levels) in <top (required)>' # /builddir/build/BUILD/spec/helpers.rb:56:in `block in included' 2) with a Fiber scheduler can send lots of data per put_copy_data Failure/Error: run_with_scheduler(60) do |conn| conn.exec <<-EOSQL CREATE TEMP TABLE copytable (col1 TEXT); EOSQL res = nil conn.copy_data( "COPY copytable FROM STDOUT CSV" ) do data = "x" * 1000 * 1000 data << "\n" 50.times do RuntimeError: scheduler timeout in: /builddir/build/BUILD/spec/helpers/scheduler.rb:57:in `select' /builddir/build/BUILD/spec/helpers/scheduler.rb:57:in `run' /builddir/build/BUILD/spec/helpers/scheduler.rb:130:in `close' /builddir/build/BUILD/spec/helpers/scheduler.rb:114:in `scheduler_close' # /builddir/build/BUILD/spec/helpers.rb:620:in `thread_with_timeout' # /builddir/build/BUILD/spec/helpers.rb:625:in `run_with_scheduler' # ./spec/pg/scheduler_spec.rb:153:in `block (2 levels) in <top (required)>' # /builddir/build/BUILD/spec/helpers.rb:56:in `block in included' ~~~ And there are the 3 failures since kernel-6.10.6-100.fc39.x86_64: ~~~ 1) with a Fiber scheduler can send lots of data per put_copy_data Failure/Error: run_with_scheduler(60) do |conn| conn.exec <<-EOSQL CREATE TEMP TABLE copytable (col1 TEXT); EOSQL res = nil conn.copy_data( "COPY copytable FROM STDOUT CSV" ) do data = "x" * 1000 * 1000 data << "\n" 50.times do RuntimeError: scheduler timeout in: /builddir/build/BUILD/spec/helpers/scheduler.rb:57:in `select' /builddir/build/BUILD/spec/helpers/scheduler.rb:57:in `run' /builddir/build/BUILD/spec/helpers/scheduler.rb:130:in `close' /builddir/build/BUILD/spec/helpers/scheduler.rb:114:in `scheduler_close' # /builddir/build/BUILD/spec/helpers.rb:620:in `thread_with_timeout' # /builddir/build/BUILD/spec/helpers.rb:625:in `run_with_scheduler' # ./spec/pg/scheduler_spec.rb:153:in `block (2 levels) in <top (required)>' # /builddir/build/BUILD/spec/helpers.rb:56:in `block in included' 2) with a Fiber scheduler waits when sending query data Failure/Error: run_with_scheduler do |conn| data = "x" * 1000 * 1000 * 10 res = conn.exec_params("SELECT LENGTH($1)", [data]) expect(res.values).to eq([[data.length.to_s]]) end RuntimeError: scheduler timeout in: /builddir/build/BUILD/spec/helpers/scheduler.rb:57:in `select' /builddir/build/BUILD/spec/helpers/scheduler.rb:57:in `run' /builddir/build/BUILD/spec/helpers/scheduler.rb:130:in `close' /builddir/build/BUILD/spec/helpers/scheduler.rb:114:in `scheduler_close' # /builddir/build/BUILD/spec/helpers.rb:620:in `thread_with_timeout' # /builddir/build/BUILD/spec/helpers.rb:625:in `run_with_scheduler' # ./spec/pg/scheduler_spec.rb:43:in `block (2 levels) in <top (required)>' # /builddir/build/BUILD/spec/helpers.rb:56:in `block in included' 3) with a Fiber scheduler should convert strings and parameters to #prepare and #exec_prepared Failure/Error: run_with_scheduler do |conn| conn.prepare("weiß1", "VALUES( LENGTH($1), 'grün')") data = "x" * 1000 * 1000 * 10 r = conn.exec_prepared("weiß1", [data]) expect( r.values ).to eq( [[data.length.to_s, 'grün']] ) end RuntimeError: scheduler timeout in: /builddir/build/BUILD/spec/helpers/scheduler.rb:57:in `select' /builddir/build/BUILD/spec/helpers/scheduler.rb:57:in `run' /builddir/build/BUILD/spec/helpers/scheduler.rb:130:in `close' /builddir/build/BUILD/spec/helpers/scheduler.rb:114:in `scheduler_close' # /builddir/build/BUILD/spec/helpers.rb:620:in `thread_with_timeout' # /builddir/build/BUILD/spec/helpers.rb:625:in `run_with_scheduler' # ./spec/pg/scheduler_spec.rb:211:in `block (2 levels) in <top (required)>' # /builddir/build/BUILD/spec/helpers.rb:56:in `block in included' ~~~
Re-assigning to PostgreSQL for start. Can somebody reproduce the issues with plain SQL? I think it should be possible to reconstruct the queries with the bits displayed in the errors.
(In reply to Vít Ondruch from comment #2) > And there are the 3 failures since kernel-6.10.6-100.fc39.x86_64: Sorry, this should have been kernel-6.10.7-100.fc39.x86_64
Just FTR, only the failing test cases can be executed with GDB like this: ~~~ $ gdb --args ruby-mri -S --verbose rspec -I~/build/BUILD/rubygem-pg-1.5.7-build/pg-1.5.7/usr/lib64/gems/ruby/pg-1.5.7 -f d spec/pg/scheduler_spec.rb:43:153:211 ~~~
These are the test cases: https://github.com/ged/ruby-pg/blob/0ac827c3b3105f5ebed625ed37657587a0b4b712/spec/pg/scheduler_spec.rb#L152C1-L169C5 ~~~ it "can send lots of data per put_copy_data" do run_with_scheduler(60) do |conn| conn.exec <<-EOSQL CREATE TEMP TABLE copytable (col1 TEXT); EOSQL res = nil conn.copy_data( "COPY copytable FROM STDOUT CSV" ) do data = "x" * 1000 * 1000 data << "\n" 50.times do res = conn.put_copy_data(data) break if res == false end end expect( res ).to be_truthy end end ~~~ https://github.com/ged/ruby-pg/blob/0ac827c3b3105f5ebed625ed37657587a0b4b712/spec/pg/scheduler_spec.rb#L42-L48 ~~~ it "waits when sending query data" do run_with_scheduler do |conn| data = "x" * 1000 * 1000 * 10 res = conn.exec_params("SELECT LENGTH($1)", [data]) expect(res.values).to eq([[data.length.to_s]]) end end ~~~ https://github.com/ged/ruby-pg/blob/0ac827c3b3105f5ebed625ed37657587a0b4b712/spec/pg/scheduler_spec.rb#L210C1-L217C5 ~~~ it "should convert strings and parameters to #prepare and #exec_prepared" do run_with_scheduler do |conn| conn.prepare("weiß1", "VALUES( LENGTH($1), 'grün')") data = "x" * 1000 * 1000 * 10 r = conn.exec_prepared("weiß1", [data]) expect( r.values ).to eq( [[data.length.to_s, 'grün']] ) end end ~~~
I cannot reproduce the first issue with kernel-6.10.0-0.rc0.20240514gita5131c3fdf26.2.eln136.x86_64 while it starts to appear with kernel-6.10.0-0.rc0.20240517gitea5f6ad9ad96.6.eln136.x86_64 (I have used ELN kernels, because the Fedora kernels are already garbage-collected)
Sadly, I have to disabl the offending test cases for the moment: https://src.fedoraproject.org/rpms/rubygem-pg/c/3e119a653e7e8d123cdce3f48e749d0c5ea52889
FEDORA-2024-fd8ed281fb (rubygem-pg-1.5.9-2.fc42) has been submitted as an update to Fedora 42. https://bodhi.fedoraproject.org/updates/FEDORA-2024-fd8ed281fb
FEDORA-2024-fd8ed281fb (rubygem-pg-1.5.9-2.fc42) has been pushed to the Fedora 42 stable repository. If problem still persists, please make note of it in this bug report.
This was fixed on rubygem-pg side.