I have a lot of difficulty helping figuring out where it is hanging if I can not figure out which line it is stuck at.

Maybe the big query it runs at the end never returns? Maybe the first query fails?

Maybe it should not be doing a find_each here and instead it should do a limit 100

My guess is the simplest way for you to ublock yourself would be to set clean_up_uploads to false. But … you are likely to hit storage problems cause files that are abandoned will stick around in your system forever.

that says it’s hung in a DELETE statement – can we check the pg stats for which statement is running right now?

The cleanup job must have started multiple times via the regular sidekiq schedule, but I see no “DELETE waiting” tasks in /admin/upgrade#/processes now. What happens with tasks from scheduled jobs when sidekiq restarts, do they go zombie and get cleaned out, run to completion, or does the next run of the job clean them up?

Hopefully Gunnar will have a chance to look at pg stats today (He’s on the west coast).