StudSec / pwncrates

A CTF framework with a focus on educational benefit.
https://ctf.studsec.nl
GNU General Public License v3.0
5 stars 8 forks source link

SQL multithreading #45

Open Aidan-Stephenson opened 6 months ago

Aidan-Stephenson commented 6 months ago

Describe the bug Currently, each worker process has its own sql connection with thread checking enabled (but connection shared beyond that). While this works most of the time, during the git update cycle a new thread is created, violating the same-thread constraint.

This needs to be fixed on two levels: 1) if an update fails, the git repo needs to be rolled back so it can be attempted again 2) The git update thread needs its own connection. (And in general database.py should probably be rewritten)

To Reproduce Steps to reproduce the behavior:

  1. Run in production mode
  2. Induce a git update

Expected behavior Git update to happen, regardless of failure