rails-on-services / apartment

Database multi-tenancy for Rack (and Rails) applications
388 stars 159 forks source link

Cannot expire connection, it is not currently leased #283

Open bharathiraja-mallow opened 3 months ago

bharathiraja-mallow commented 3 months ago

Steps to reproduce

Recently, we have added apartment gem for our multiple schema usecase in postgres. It was working smoothly for some days. Usually we receive a high traffic in our sidekiq server on month end. In that time, things are started getting break and facing the below error on ActiveJobs

ActiveRecord::ActiveRecordError: Cannot expire connection, it is not currently leased.

Once this error is raised, that particular job is moved to retry set in sidekiq and reprocessed again. However, it isn't complete. It reaches the maximum retry count and gets shifted to dead state

Can anyone from this community share your thoughts on this? Would help a lot to us

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] commented 13 hours ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.