The last successful PlatformStatsSummaryJob ran on October 11th.
Since then we've seen it failing with the error:
`[previous exception] [object] (PDOException(code: HY000): SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared at /var/www/html/app/Jobs/PlatformStatsSummaryJob.php:158)
[stacktrace]`
We never appear to see this error locally. It appears to be fired from https://github.com/wbstack/api/blob/main/app/Jobs/PlatformStatsSummaryJob.php#L148 which is particularly surprising since we would expect these prepared statements to be emulated anyway due to https://github.com/wbstack/api/blob/main/app/Jobs/PlatformStatsSummaryJob.php#L144C33-L144C54. We did speculate that this setting might be being race away by a race causing it to `purge` the connection and therefore that the fix might look like T346245. This appears not to be the case although as specified in the ticket there is the possibility that it's an different purge somewhere else.
Notably nothing happened on the deploy repo so I did wonder if the issue was due to one of our more stateful services. I restarted the api-queue as well as sql primary and secondary. This does not appear to have resolved the issues