vol: Add timeouts to SYNC server select() calls
authorAndrew Deason <adeason@sinenomine.net>
Tue, 29 Mar 2011 17:28:46 +0000 (12:28 -0500)
committerDerrick Brashear <shadow@dementia.org>
Wed, 30 Mar 2011 15:10:07 +0000 (08:10 -0700)
commit920a00e075b679f59e31b9fcbe7f5db15e345a95
treeecdfa22a70c74e0115a240c52f4f6aa2719c38f0
parente2cd861cdf30735897cf32617b7641cbd2be1229
vol: Add timeouts to SYNC server select() calls

Normally *SYNC server processes wait indefinitely for activity to
occur on one of the SYNC sockets. On some Linux kernels, there exists
a race condition where data can come in on a socket, but the select()
call continues to wait. To ensure that we do not hang forever in such
a scenario, add a timeout to the select() call, which will ensure we
notice the new data within 10 seconds. Raise the timeout on non-Linux
to reduce impact elsewhere.

The Linux kernel bug is tracked in
<https://bugzilla.redhat.com/show_bug.cgi?id=494404>, though that bug
report may not represent all affected kernels.

Change-Id: I3250eb53d59610ccbcffe9e8e283984d5ae0e2b4
Reviewed-on: http://gerrit.openafs.org/4377
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/vol/daemon_com.h
src/vol/fssync-server.c
src/vol/salvsync-server.c