Use case: a template operator that calls ezexecution::cleanexit in its modify() method is put in a node template. viewcache is on.
Arguably bad practice, but still not disallowed by eZP apis.
What happens is that the ezdb file handler creates a .generating file in the db, and never removes it, since it stops execution halfway through.
When a 2nd request arrives for that same page, it will wait 60 seconds to steal the .generating file, then alter its mtime col and "suicide", leaving the .generating file still in the db.
If there are say 10 almost-concurrent requests for that page, they will all queue up, sending 1 request per second to the db. If there are more, load on db can increment quickly.
The proposed fix:
1. when initializing db file handler, set up a new cleanup handler
2. when creating a new .generating file, store it in a static var: name+timestamp
3. when aborting cache gen / completing cache gen, remove .generating file from static var
4. shutdown handler checks if there are any leftover files in its static var and removes them