check / check (push) Canceled after 0s
The AS, peer and prefix handlers wrote their batch to the database while holding the mutex HandleMessage needs, so while a write ran nothing was taken off their queues and the streamer dropped updates. Each handler now writes only from its flush goroutine: it takes the batch under the mutex, leaves an empty one in its place, and writes after releasing it. A full batch wakes the flush goroutine. While a write runs the next batch may grow to ten batch sizes; at that size HandleMessage waits, so the queue fills and the streamer drops as before. README "Memory" gives the numbers and their cost. Model: opus-5-5