Concurrrency issue with psycopg2.ThreadConnectionPool, uWSGI and Flask
You are initializing the threadpool in the master, after it calls fork() (to generate workers) all will be messed up (unless you manage it). Ensure to initialize the pool one time per worker or use lazy-apps = true in uWSGI to load the app one time per worker.