France-ioi / AlgoreaBackend

Backend for the new Algorea platform
MIT License
1 stars 2 forks source link

Stop mysql queries when the a request handler is terminated #1048

Open smadbe opened 5 months ago

smadbe commented 5 months ago

Motivations

We discovered during our investigations on 3/04/24 (around 4pm UTC+2) that when a service was starting a very long SQL query (250s in this case) and this service was killed (lambda timeout) after 15sec, the CPU intensive query was still running to the end on the SQL server... with the consequence of making things worse of course.

Notes

The way lambda "kills" request is by using a Golang Context.WithDeadline (cfr lambda lib).

Subtasks