mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
BackupSync task would switch between databases to update backup usage metrics in the cloud_usage.usage_backup table. The current framework and the usage in ManagedContext causes database connection (LegacyTransaction) leaks. When the thread runs faster, the issue is easily reproducible and checking via heap dump analysis or using JMX MBeans. This fixes by moving the task of backup data updation for usage data to the usage server by publishing usage events instead of switching between databases in a local thread while in a ManagedContextRunnable. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>