[OpenSRF-GIT] OpenSRF branch rel_2_0 updated. osrf_rel_2_0_1-5-gab63faa
Evergreen Git
git at git.evergreen-ils.org
Fri Oct 28 11:51:58 EDT 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenSRF".
The branch, rel_2_0 has been updated
via ab63faa85e349020774e0b3297a84370281d573f (commit)
from 78ad2cc45c408a28ecb103099827659162f88d2b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ab63faa85e349020774e0b3297a84370281d573f
Author: Bill Erickson <berick at esilibrary.com>
Date: Fri Oct 28 11:33:24 2011 -0400
Add SIGPIPE retry handling to child data sysread
Similar to the SIGPIPE retry logic wrapped around the parent process'
syswrite call (for sending data to a child process), protect the child's
sysread call (as it reads data from the parent). In pre-2.0, the
sysread step was handled by Net::Server, but now we need to protect it
ourselves.
Signed-off-by: Bill Erickson <berick at esilibrary.com>
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
diff --git a/src/perl/lib/OpenSRF/Server.pm b/src/perl/lib/OpenSRF/Server.pm
index 28980d3..9e7ffa8 100644
--- a/src/perl/lib/OpenSRF/Server.pm
+++ b/src/perl/lib/OpenSRF/Server.pm
@@ -589,10 +589,20 @@ sub wait_for_request {
while(1) {
# Start out blocking, when data is available, read it all
+ my $sig_pipe = 0;
+ local $SIG{'PIPE'} = sub { $sig_pipe = 1 };
+
my $buf = '';
my $n = sysread($self->{pipe_to_parent}, $buf, $read_size);
unless(defined $n) {
+
+ if ($sig_pipe) {
+ $logger->info("server: $self got SIGPIPE reading data from parent, retrying...");
+ usleep(50000); # 50 msec
+ next;
+ }
+
$logger->error("server: error reading data pipe: $!") unless EAGAIN == $!;
last;
}
-----------------------------------------------------------------------
Summary of changes:
src/perl/lib/OpenSRF/Server.pm | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
hooks/post-receive
--
OpenSRF
More information about the opensrf-commits
mailing list