A debugging story details an issue with a PostgreSQL query that hangs when using LIMIT 10 but works with LIMIT 9. The problem is linked to WebSocket payload lengths and an underlying bug in the undici package's handling of WebSocket frames in Node.js. The story highlights the nuances of WebSocket framing, the importance of precise buffer management, and how a small code fix resolved the problem.
Table of contents
WiresharkingWebSocket payload lengthsHacking on undiciBuffers, ArrayBuffers and subarraysWait, what?A happy endingPerformance: a footnoteSort: