It froze again 40 minutes later with no outside process holding the database; only the server had statev2.sqlite open. This time the reader was the server's own shell snapshot. loadShellSnapshot ran a sql.transaction on the reader connection for 39 to 66 s while the machine was under load (load average 15) and the WAL was 33.7 MB. Writer statements waited up to 78 s for the writer lock until that read ended. It happened from 12:49 to 12:51 and again from 12:52 to 12:53 (UTC+4).
| 1 | start end s span connection lock wait s |
| 2 | 12:52:29 12:53:27 58.2 sql.transaction (loadShellSnapshot) reader 0.0 |
| 3 | 12:52:42 12:53:37 55.4 sql.transaction writer 55.4 |
| 4 | 12:52:48 12:53:38 50.4 sql.transaction writer 50.4 |
| 5 | 12:53:00 12:53:39 38.9 sql.transaction writer 38.9 |
So the gate needs no outside reader. Once the WAL is past 32 MB, any slow read on the server's own reader connection freezes writes for as long as that read lasts.