Skip to content

Commit

Permalink
[backend] improve automatic transient error detection
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed May 6, 2016
1 parent d025c3c commit 0674eb4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/backend/BSSched/RPC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ sub new {
sub is_transient_error {
my ($error) = @_;
return 1 if $error =~ /^5\d\d/;
return 1 if $error =~ /Too many open files/;
if ($error =~ /^400/) {
return 1 if $error =~ /Too many open files/;
return 1 if $error =~ /No space left on device/;
return 1 if $error =~ /Not enough space/;
return 1 if $error =~ /Resource temporarily unavailable/;
}
return 0 if $error =~ /remote error:/;
return 1;
}
Expand Down
4 changes: 4 additions & 0 deletions src/backend/BSServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ sub parse_error_string {
$tag = $2;
} elsif ($err =~ /^([^\r\n]+)/) {
$tag = $1;
$code = 500 if $tag =~ /Too many open files/;
$code = 500 if $tag =~ /No space left on device/;
$code = 500 if $tag =~ /Not enough space/;
$code = 500 if $tag =~ /Resource temporarily unavailable/;
} else {
$tag = 'Error';
}
Expand Down

0 comments on commit 0674eb4

Please sign in to comment.