When LIMIT 9 works but LIMIT 10 hangs: A short debugging story

A bug that caused queries via serverless platforms that only support WebSockets but not Transmission Control Protocol (TCP) to hang has been identified. Developer and writer Mark Dominus documented the process he took to debug the issue. The problem lay with undici, software for supporting WebSockets in Node.js 18. In trying to create a response to this protocol, the undici code pulled in Node’s Buffer.allocUnsafe() function, which helpfully provides a fresh buffer for any undesignated bytes it might hold. This resilience created problems, though, when the undici code passed a mistaken length value to the buffer, corrupting the transmission.

https://neon.tech/blog/when-limit-9-works-but-limit-10-hangs

To top