Description
Raised from BSP-3765. The customer reported massive slowdowns/lockups and OOMs after running Bamboo for ~2 days.
Customer export contains 15 000 of expired access tokens and 30 000 of expired consumer tokens. Due to implementation of cleanup process in SAL plugin, a cleanup of these records requires 675 million (give or take a couple million) database queries. This obviously never finishes in time - the amount of tokens added to the installations easily exceeds the capacity of cleanup. This ties down database connections and causes Bamboo to become unresponsive.
Bug for the root cause raised here: OAUTH-172 , bug for the expiry process will be raised later.
Need to upgrade SAL plugin after the root cause and the cleanup implementation is fixed.