Issues in Database Commits by Background Workers


I have a webapp, built in Flask, using several background workers. Overall the system works fine and background workers are able to make the database commits as needed. However, every once in a while the database commit by a background worker fails. I cant figure out why this happens sometimes.

The possibility I am thinking about is that, since background workers are also querying the database and so is there a possibility that one background worker task queries the database at exactly the same time as another tasks tries a commit, and so the commit fails?

Though it seems to be that I could have 97 connections? I am only at 5 maximum, including all background workers as a separate connection…

Any thoughts?


Hi there,

Databases have mechanisms to deal with a read and a write occurring at the same time (and vice versa), so it’s unlikely to be that - you’d need to investigate logs (and if you don’t see anything add debug logs) to understand what’s going on here, it’s most likely an application issue,


John B
Render Support, UTC+1 :uk:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.