arvados-cli 0.1.20170807174734 → 0.1.20170817171636
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/crunch-job +19 -19
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87694867eb121f49f8d0e22049c263ec29a104fe
|
4
|
+
data.tar.gz: 92878792b8b22c8e7128cf522b101c97dafac270
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32aa9a72b8877b47a64c8a40fa0d0161c654e022ace8c3606fd632c7878e6c643c72fbab6b2e2afac69485d2d74446bf57bffcd0581303af2eccc21c7dd717ad
|
7
|
+
data.tar.gz: 1c810a954468888c942aa4fb0f2faff97680cb1efd3864ed069bd51aedc9c542b4fb588f5c6f33e600ece802b36deeb90655bda6cc8171495a847de2e547e7ac
|
data/bin/crunch-job
CHANGED
@@ -1022,7 +1022,7 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
|
|
1022
1022
|
delete $Jobstep->{tempfail};
|
1023
1023
|
|
1024
1024
|
$Jobstep->{'arvados_task'}->{started_at} = strftime "%Y-%m-%dT%H:%M:%SZ", gmtime($Jobstep->{starttime});
|
1025
|
-
$Jobstep->{'arvados_task'}->save;
|
1025
|
+
retry_op(sub { $Jobstep->{'arvados_task'}->save; }, "job_tasks.update API");
|
1026
1026
|
|
1027
1027
|
splice @jobstep_todo, $todo_ptr, 1;
|
1028
1028
|
--$todo_ptr;
|
@@ -1205,7 +1205,7 @@ sub reapchildren
|
|
1205
1205
|
"ERROR: Task process exited %s, but never updated its task record to indicate success and record its output.",
|
1206
1206
|
exit_status_s($childstatus)));
|
1207
1207
|
$Jobstep->{'arvados_task'}->{success} = 0;
|
1208
|
-
$Jobstep->{'arvados_task'}->save;
|
1208
|
+
retry_op(sub { $Jobstep->{'arvados_task'}->save; }, "job_tasks.update API");
|
1209
1209
|
$task_success = 0;
|
1210
1210
|
}
|
1211
1211
|
|
@@ -1258,7 +1258,7 @@ sub reapchildren
|
|
1258
1258
|
$Jobstep->{exitcode} = $childstatus;
|
1259
1259
|
$Jobstep->{finishtime} = time;
|
1260
1260
|
$Jobstep->{'arvados_task'}->{finished_at} = strftime "%Y-%m-%dT%H:%M:%SZ", gmtime($Jobstep->{finishtime});
|
1261
|
-
$Jobstep->{'arvados_task'}->save;
|
1261
|
+
retry_op(sub { $Jobstep->{'arvados_task'}->save; }, "job_tasks.update API");
|
1262
1262
|
process_stderr_final ($jobstepidx);
|
1263
1263
|
Log ($jobstepidx, sprintf("task output (%d bytes): %s",
|
1264
1264
|
length($Jobstep->{'arvados_task'}->{output}),
|
@@ -2177,8 +2177,22 @@ sub retry_op {
|
|
2177
2177
|
# that can be retried, the second function will be called with
|
2178
2178
|
# the current try count (0-based), next try time, and error message.
|
2179
2179
|
my $operation = shift;
|
2180
|
-
my $
|
2180
|
+
my $op_text = shift;
|
2181
2181
|
my $retries = retry_count();
|
2182
|
+
my $retry_callback = sub {
|
2183
|
+
my ($try_count, $next_try_at, $errmsg) = @_;
|
2184
|
+
$errmsg =~ s/\s*\bat \Q$0\E line \d+\.?\s*//;
|
2185
|
+
$errmsg =~ s/\s/ /g;
|
2186
|
+
$errmsg =~ s/\s+$//;
|
2187
|
+
my $retry_msg;
|
2188
|
+
if ($next_try_at < time) {
|
2189
|
+
$retry_msg = "Retrying.";
|
2190
|
+
} else {
|
2191
|
+
my $next_try_fmt = strftime "%Y-%m-%dT%H:%M:%SZ", gmtime($next_try_at);
|
2192
|
+
$retry_msg = "Retrying at $next_try_fmt.";
|
2193
|
+
}
|
2194
|
+
Log(undef, "$op_text failed: $errmsg. $retry_msg");
|
2195
|
+
};
|
2182
2196
|
foreach my $try_count (0..$retries) {
|
2183
2197
|
my $next_try = time + (2 ** $try_count);
|
2184
2198
|
my $result = eval { $operation->(@_); };
|
@@ -2201,25 +2215,11 @@ sub api_call {
|
|
2201
2215
|
# This function will call that method, retrying as needed until
|
2202
2216
|
# the current retry_count is exhausted, with a log on the first failure.
|
2203
2217
|
my $method_name = shift;
|
2204
|
-
my $log_api_retry = sub {
|
2205
|
-
my ($try_count, $next_try_at, $errmsg) = @_;
|
2206
|
-
$errmsg =~ s/\s*\bat \Q$0\E line \d+\.?\s*//;
|
2207
|
-
$errmsg =~ s/\s/ /g;
|
2208
|
-
$errmsg =~ s/\s+$//;
|
2209
|
-
my $retry_msg;
|
2210
|
-
if ($next_try_at < time) {
|
2211
|
-
$retry_msg = "Retrying.";
|
2212
|
-
} else {
|
2213
|
-
my $next_try_fmt = strftime "%Y-%m-%dT%H:%M:%SZ", gmtime($next_try_at);
|
2214
|
-
$retry_msg = "Retrying at $next_try_fmt.";
|
2215
|
-
}
|
2216
|
-
Log(undef, "API method $method_name failed: $errmsg. $retry_msg");
|
2217
|
-
};
|
2218
2218
|
my $method = $arv;
|
2219
2219
|
foreach my $key (split(/\//, $method_name)) {
|
2220
2220
|
$method = $method->{$key};
|
2221
2221
|
}
|
2222
|
-
return retry_op(sub { $method->execute(@_); }, $
|
2222
|
+
return retry_op(sub { $method->execute(@_); }, "API method $method_name", @_);
|
2223
2223
|
}
|
2224
2224
|
|
2225
2225
|
sub exit_status_s {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arvados-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20170817171636
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arvados Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: arvados
|
@@ -164,7 +164,7 @@ dependencies:
|
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0.8'
|
167
|
-
description: Arvados command line tools, git commit
|
167
|
+
description: Arvados command line tools, git commit 0b4800608e6394d66deec9cecea610c5fbbd75ad
|
168
168
|
email: gem-dev@curoverse.com
|
169
169
|
executables:
|
170
170
|
- arv
|