]> git.evergreen-ils.org Git - OpenSRF.git/commit
Sync parent/child write/read with lock file
authorBill Erickson <berick@esilibrary.com>
Mon, 7 Nov 2011 22:30:44 +0000 (17:30 -0500)
committerDan Scott <dscott@laurentian.ca>
Wed, 4 Jan 2012 04:55:46 +0000 (23:55 -0500)
commit89f41c82798dbac56716fdd5beeb6c0de3e4ce2e
tree1c4ae6cf8d5879cd72e697e09bdf9e7b973c3919
parent3d089bdfd067676f99807f7cb2014e122c4dbf72
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>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
bin/opensrf-perl.pl.in
src/perl/lib/OpenSRF/Server.pm
src/perl/lib/OpenSRF/System.pm