Change mysqladmin ping timeout

Don’t mind monkeying with the code and reapplying changes afterwards. I changed the maxTries to 30 and still wasn’t able to start the database, so I added this in the catch statement:

this._logger.debug(`No database ping response, try ${i}`);

Then ran tail -f ~/Library/Logs/local-lightning-verbose.log in my terminal.

Noticed that $i was being incremented twice. The catch() statement is also incrementing the variable in addition to the for statement, so that might be a minor bug. It should try to ping the database for about 15 seconds, but it’s only trying for about 7-8 seconds.

{"level":"debug","message":"No database ping response, try 0","service":{},"serviceBinVersion":{},"thread":"main","timestamp":"2024-08-28T13:18:22.460Z"}
{"level":"debug","message":"No database ping response, try 2","service":{},"serviceBinVersion":{},"thread":"main","timestamp":"2024-08-28T13:18:23.478Z"}
{"level":"debug","message":"No database ping response, try 4","service":{},"serviceBinVersion":{},"thread":"main","timestamp":"2024-08-28T13:18:24.494Z"}
{"level":"debug","message":"No database ping response, try 6","service":{},"serviceBinVersion":{},"thread":"main","timestamp":"2024-08-28T13:18:25.512Z"}
{"level":"debug","message":"No database ping response, try 8","service":{},"serviceBinVersion":{},"thread":"main","timestamp":"2024-08-28T13:18:26.532Z"}
{"level":"debug","message":"No database ping response, try 10","service":{},"serviceBinVersion":{},"thread":"main","timestamp":"2024-08-28T13:18:27.548Z"}
{"level":"debug","message":"No database ping response, try 12","service":{},"serviceBinVersion":{},"thread":"main","timestamp":"2024-08-28T13:18:28.564Z"}

After removing the increment in the catch statement, and bumping my number of tries to 45 (the db has over 25k tables), it starts up just fine. Thank you!

3 Likes