Please sign in to comment.
unix: fix loop starvation under high network load
uv__read() and uv__udp_recvmsg() read incoming data in a loop. If data comes in at high speeds, the kernel receive buffer never drains and said functions never terminate, stalling the event loop indefinitely. Limit the number of consecutive reads to 32 to stop that from happening. The number 32 was chosen at random. Empirically, it seems to maintain a high throughput while still making the event loop move forward at a reasonable pace. This is a back-port of commit 738b31e from the master branch. Conflicts: src/unix/stream.c
- Loading branch information...
Showing with 16 additions and 3 deletions.