Closed casperisfine closed 3 years ago
We tested this in production, it works as expected.
It's far from perfect because on EINTR
the timeout duration is basically reset, but that's not something that should happen much in practice except during profiling, so not really a concern.
There was two places where
libmemcached
usespoll
but doesn't handleEINTR
.One was on the
connect
path, the other in the non-blocking IO read path.I applied a similar path to both, basically unlimited retry as long as poll fail with
errno == EINTR
.I wrote two tests relying on StackProf, to make sure they are close to reality.