Skip to content

Intermittent connection issues with Ruby 3.2 and 3.3. #1415

@MrJoy

Description

@MrJoy

This is less a bug report and more a request for some guidance.

We're seeing what appears to be a pair of issues affecting both mysql2 and trilogy -- only under Ruby 3.2 and/or 3.3.

We recently updated an app from Ruby 3.1.6 to 3.3.8 / 3.3.9 (first one, then the other -- both are affected), and started seeing both connection timeouts (only from the mysql2 gem) and dropped connections (both mysql2 and trilogy). They are infrequent, relative to the workload, but not rare: We're seeing about 5-10 occurrences of each per hour. The connection timeouts are coming from a web service handling about 9k req/sec, and the dropped connections are coming from a Sidekiq service handling about 1 job/sec.

I downgraded to 3.1.6 and confirmed both issues went away. I upgraded to 3.2.9 to bisect my way to an exact Ruby version that introduced the issue and... the dropped connection issue recurred (at about the same frequency as before) -- but not the connection timeout issue.

Our deploy process is such that I can be certain that no OS packages or configuration were changed as I flipped between Ruby versions, and no application code or configuration changes happened either. (For the sake of thoroughness: Our images are all currently Debian 13. We build Ruby from source. We're using mysql2 0.5.7.)

So, it sure looks like we're running into not one, but two separate Ruby changes that have perhaps pulled the rug out from under mysql2 / trilogy.

In all cases, the stack traces terminate at the boundary to the C extension, of course.

So, I'm wondering if you can provide any insight on how I might be able to get more useful information to diagnose things further in order to file a useful bug report with the Ruby folks.

Beyond bisecting to exact Ruby versions that introduce the issues (and crossing my fingers and hoping they're part of a patchlevel change that would never the scope of changes that could be at issue), do you have any specific diagnostic steps you'd recommend?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions