Sync parent/child write/read with lock file collab/berick/perl-server-read-write-flock
authorBill Erickson <berick@esilibrary.com>
Mon, 7 Nov 2011 22:30:44 +0000 (17:30 -0500)
committerBill Erickson <berick@esilibrary.com>
Tue, 8 Nov 2011 23:07:23 +0000 (18:07 -0500)
commit34427dd64c23a2ad1b848d2ad3f4e129c7893c75
tree3ce04218b23b0bd4d216e39c9d75e2bd0bfeb053
parent3a4ae77be13349fae180fdc81bcc23e5a93032b4
Sync parent/child write/read with lock file

Wrap parent writes to child socket and initial child reads of the
socket in file lock (via flock()) to prevent rare race condition
where child process reads to the end of the data before the parent
has written all bytes.

This create a new lock file on the system, which resides in the same
directory as the pid files.  The lock file is created and destroyed by
the opensrf perl mods at service start up and shutdown.

See also https://bugs.launchpad.net/opensrf/+bug/883155

Signed-off-by: Bill Erickson <berick@esilibrary.com>
bin/opensrf-perl.pl.in
src/perl/lib/OpenSRF/Server.pm
src/perl/lib/OpenSRF/System.pm