Skip to content

Commit 61a6aa8

Browse files
committed
fixed 4G stageout bug
1 parent 04208ac commit 61a6aa8

File tree

1 file changed

+15
-5
lines changed
  • cogkit/modules/provider-coaster/resources

1 file changed

+15
-5
lines changed

cogkit/modules/provider-coaster/resources/worker.pl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@
127127

128128
my $TAG = int(rand(10000));
129129
use constant RETRIES => 3;
130-
use constant CHANNEL_TIMEOUT => 180;
130+
# increased to avoid timeout on Blue Waters during quiesce events
131+
use constant CHANNEL_TIMEOUT => 300;
131132
use constant HEARTBEAT_INTERVAL => 60;
132133
use constant MAXFRAGS => 16;
133134
# TODO: Make this configurable (#537)
@@ -570,14 +571,23 @@ sub sockSend {
570571
my ($buf) = @_;
571572

572573
my $start = time();
573-
my $r = $SOCK->send($buf, 0);
574-
my $err = $!;
574+
my $r;
575+
my $err;
576+
eval {
577+
$r = $SOCK->send($buf, 0);
578+
$err = $!; # possibly EPIPE
579+
};
580+
if ($@) {
581+
$err = $@;
582+
wlog(DEBUG, "Caught send error: $err\n");
583+
}
575584
if (!defined $r) {
576585
if ($err == POSIX::EWOULDBLOCK) {
577586
wlog(TRACE, "Send would block\n");
578587
$r = 0;
579588
}
580-
elsif ($err == POSIX::EPIPE) {
589+
elsif (($err == POSIX::EPIPE) || (index($err, "send: Cannot determine peer address") != -1)) {
590+
initiateReconnect();
581591
wlog(INFO, "Broken pipe; trying to re-connect\n");
582592
$CONNECTED = 0;
583593
reconnect();
@@ -738,7 +748,7 @@ sub nextFileData {
738748
}
739749
elsif ($s == PUT_CMD_SENT) {
740750
$$state{"state"} = $s + 1;
741-
return (0, pack("VV", $$state{"size"}, 0), CONTINUE);
751+
return (0, pack("VV", $$state{"size"} & 0xffffffff, $$state{"size"} >> 32), CONTINUE);
742752
}
743753
elsif ($s == PUT_SIZE_SENT) {
744754
$$state{"state"} = $s + 1;

0 commit comments

Comments
 (0)