NullPointerException in JDBCPersistentIdStoreEx when MySQL is busy
Description
Environment
Activity
All the cases like this routinely boil down to "the database has decided transactions no longer mean anything, so we're not taking locks when we're required to". The only fix for that is retries, but in this case the lack of a SQLState makes that a problem since there's no status code to check for. That's the only thing about this case that concerns me, I have no idea what the actual exception is.
But, as a strict matter, yes, the NPE is fixed, so I'll close the issue out and if it arises in the future it will be a more specific problem we can identify.

Since this has only happened twice due to thundering herds of students and went away when we gave the DB more CPU and RAM I'm not that keen subjecting our students to failing IDPs again.
I understand that this is not what you wanted to hear.
I wonder if this is reproduceable with a load tester?
We're satisfied with this solution, you can close the ticket.
Didn't notice you'd taken it, but the bug's just a simple error check, fixed in r8376. The SQLException it raised didn't contain a SQLState field.
I'll leave it open and assigned to you if you want to dig into why, but I suspect it would be easier to have Simon test with the patched code and observe the actual exception it raises.
I'll take this to start with
When our MySQL which stores the persistent IDs gets overloaded the IDP starts to throw NPEs and seemingly random people can't login and get an NPE error in their browser.
We have not been able to correlate why some SPs work for a user who gets an NPE on another SP.
Log: