PRX / feeder.prx.org

Dovetail podcast content management system
https://podcasts.dovetail.prx.org
GNU Affero General Public License v3.0
5 stars 0 forks source link

Lock podcast until timestamp #1076

Closed cavis closed 2 months ago

cavis commented 2 months ago

We've been getting some large (multiple thousands) RSS imports lately.

After #1066 and #1067, we seem to get through the initial "import" without clogging the workers.

But now, the thousands of Porter callbacks seem to be clogging the publish queue. Yesterday, I ended up setting locked = true on a Podcast and terminating hundreds of SELECT pg_advisory_lock(1, 9999) statements in postgres before the workers unblocked (they were processing < 1 job a minute... and maybe just timing out?)

This works around any contention in that publishing queue advisory lock, by delaying unlocking the podcast for 1 minute per 150 episodes. The ReleaseEpisodesJob cron will pick the Podcast up and call .publish! once we get past the podcast.locked_until timestamp.