Keno Fischer keno@juliacomputing.com writes:
It is possible for the write/writev functions in send_request to return short writes, even in non-error conditions. For example, an unfortunately timed SIGINT after the first 4096 bytes of a pipe transfer will interrupt the syscall and return. In some cases (in particular when no bytes have been transferred at all), the SA_RESTART spec on the signal handler will take care of the restart, but once any bytes have been transferred, the result will be a short write and no automatic restart. Some linux profiling and debugging tooling can also increase the rate of signal interruptions making this corner case more likely.
Signals are blocked during server requests. If you are indeed getting a SIGINT in the middle of a server call nothing can work, since the SIGINT handler will likely make a nested server call.