I occasionally see FOREIGN KEY constraint failed errors coming from silk; my hypothesis is that it's caused by the following race condition:
- a request comes into django
- silk creates a Request record
silk_clear_request_log runs, deleting all Request records
- django is done with the request
- silk tries to insert a Response record referencing the Request record from step 2
- IntegrityError is raised as step 3 deleted the Request that the Response is referencing
For now, I'm working around the issue with my own cleanup command that skips deleting any in-flight requests, but perhaps it's something that could be handled directly by silk_clear_request_log?
I occasionally see
FOREIGN KEY constraint failederrors coming from silk; my hypothesis is that it's caused by the following race condition:silk_clear_request_logruns, deleting all Request recordsFor now, I'm working around the issue with my own cleanup command that skips deleting any in-flight requests, but perhaps it's something that could be handled directly by
silk_clear_request_log?