Skip to content

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

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

Closed
jakeonfire opened this issue May 4, 2022 · 4 comments
Assignees
Milestone

Comments

@jakeonfire
Copy link
Contributor

jakeonfire commented May 4, 2022

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

@jakeonfire
Copy link
Contributor Author

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.

@jakeonfire
Copy link
Contributor Author

one idea: https://stackoverflow.com/a/26733385

@jakeonfire
Copy link
Contributor Author

jakeonfire commented May 7, 2022

@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.

@st0012 st0012 added this to the 5.4.0 milestone May 7, 2022
@st0012
Copy link
Collaborator

st0012 commented May 7, 2022

Closed via #1812

@st0012 st0012 closed this as completed May 7, 2022
@st0012 st0012 modified the milestones: 5.4.0, 5.3.1 May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants