Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI and improve discard_results #500

Merged
merged 7 commits into from
Feb 25, 2023
Merged

Update CI and improve discard_results #500

merged 7 commits into from
Feb 25, 2023

Commits on Feb 24, 2023

  1. Configuration menu
    Copy the full SHA
    dcb7272 View commit details
    Browse the repository at this point in the history
  2. Exclude scheduler tests on ruby-3.0 on Windows

    On Windows ruby-3.1 is needed.
    larskanis committed Feb 24, 2023
    Configuration menu
    Copy the full SHA
    0a9dc38 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    673f4ba View commit details
    Browse the repository at this point in the history
  4. Extend the timeout to 200 seconds

    Just to be safe, since x86-mingw32 is a bit slower.
    It takes approx 30 seconds on my Laptop with Windows in qemu-kvm.
    larskanis committed Feb 24, 2023
    Configuration menu
    Copy the full SHA
    43a675d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f99d343 View commit details
    Browse the repository at this point in the history
  6. Make sure PQconsumeInput and PQflush is called in discard_results

    .. in the busy loop and after PQputCopyEnd.
    
    This blocked on ruby-3.1 on x86-mingw32 like so:
    
      1) PG::Connection in nonblocking mode rejects to send lots of COPY data
         Failure/Error: raise("scheduler timeout in:\n#{th.backtrace.join("\n")}")
    
         RuntimeError:
           scheduler timeout in:
           D:/a/ruby-pg/ruby-pg/spec/pg/connection_spec.rb:666:in `discard_results'
           D:/a/ruby-pg/ruby-pg/spec/pg/connection_spec.rb:666:in `block (4 levels) in <top (required)>'
           D:/a/ruby-pg/ruby-pg/spec/helpers.rb:645:in `block in run_with_gate'
           D:/a/ruby-pg/ruby-pg/spec/helpers.rb:602:in `block in thread_with_timeout'
         ./spec/helpers.rb:607:in `thread_with_timeout'
         ./spec/helpers.rb:641:in `run_with_gate'
         ./spec/pg/connection_spec.rb:645:in `block (3 levels) in <top (required)>'
         ./spec/helpers.rb:55:in `block in included'
    
    Experimentation showed that under memory pressure PQflush, PQconsumeInput and PQgetResult must be called in combination to not block infinitely.
    Separate loops for PQflush+PQconsumeInput and PQgetResult+PQconsumeInput don't work and often result in starvation on Github-Actions on x86-mingw32.
    larskanis committed Feb 24, 2023
    Configuration menu
    Copy the full SHA
    4e22d53 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    91d8c88 View commit details
    Browse the repository at this point in the history