Show current requests
Sometimes on production we may have database lock due to a long request or resource exhaustion which slow down the server etc. When such thing happens it is sometimes very difficult to find which request is causing the problem. For database lock, it is possible to find the database session but it may be very hard to link it to a specific request. This is mainly because we can not know which requests are processed now (and the cron jobs or tasks).
I propose to use a signal (SIGUSR1
) to request a trytond process to dump to the log file the currently running requests, cron jobs and tasks with their starting time.
For request it will include the username if authorized, the remote address, the path, method and params (size limited from #8101 (closed)).
For cron job it will include the database, the cron id and method.
For tasks it will include the database, the task id.