Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Bug Fixes

- `Sentry::BackgroundWorker` will release `ActiveRecord` connection pool only when the `ActiveRecord` connection is established
- Remove bad encoding arguments in redis span descriptions [#1914](https://github.com/getsentry/sentry-ruby/pull/1914)
- Fixes [#1911](https://github.com/getsentry/sentry-ruby/issues/1911)

Expand Down
7 changes: 5 additions & 2 deletions sentry-rails/lib/sentry/rails/background_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ class BackgroundWorker
def _perform(&block)
block.call
ensure
# make sure the background worker returns AR connection if it accidentally acquire one during serialization
ActiveRecord::Base.connection_pool.release_connection
# some applications have partial or even no AR connection
if ActiveRecord::Base.connected?
# make sure the background worker returns AR connection if it accidentally acquire one during serialization
ActiveRecord::Base.connection_pool.release_connection
end
end
end
end