Skip to content

Cannot share a single DB connection between a unicorn worker and sentry worker #1808

Description

@jakeonfire

Issue Description

It is not possible to have a single database connection for a process that then reports a sentry error asynchronously without opening an additional connection.

we have an RDS DB with many connections, but also a huge fleet of sidekiq workers that can scale up and down in the thousands. so doubling the connection count requirement is not currently possible.

Reproduction Steps

Create a single unicorn worker with a single DB connection that generates an error to report to sentry.

Expected Behavior

The process reports the error using a single DB connection.

Actual Behavior

The process requires two DB connections to report the error.

Ruby Version

2.6.5

SDK Version

5.3.0

Integration and Its Version

No response

Sentry Config

No response

Activity

  1. jakeonfire commented on May 4, 2022

    @jakeonfire
    ContributorAuthor

    i would file this under optimizations. we have many workers with autoscaling and limited DB connections. if sentry could re-use a DB connection if needed instead of requiring a new one that would have a big impact for the number of required connections for largely horizontally scaled applications. even making it optional instead of required would be a win in some cases.

  2. jakeonfire commented on May 7, 2022

    @jakeonfire
    ContributorAuthor
  3. jakeonfire commented on May 7, 2022

    @jakeonfire
    ContributorAuthor

    @st0012 i think my PR solves the original issue without requiring an additional DB connection. the specs still hold up - as in they fail without the connection release.

  4. added this to the 5.4.0 milestone on May 7, 2022
  5. st0012 commented on May 7, 2022

    @st0012
    Contributor

    Closed via #1812

  6. modified the milestones: 5.4.0, 5.3.1 on May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions