Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix double reap of tasks on app failure #4000

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions taskvine/src/manager/vine_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,17 +1297,29 @@ static int fetch_outputs_from_worker(struct vine_manager *q, struct vine_worker_
break;
}

if (result != VINE_SUCCESS) {
debug(D_VINE, "Failed to receive output from worker %s (%s).", w->hostname, w->addrport);
handle_failure(q, w, t, result);
}
/* reap task, delete output files, or do nothing if task succeeded. */
handle_failure(q, w, t, result);

if (result == VINE_WORKER_FAILURE) {
switch (result) {
case VINE_MGR_FAILURE:
case VINE_WORKER_FAILURE:
debug(D_VINE, "Failed to receive output because of worker failure at %s (%s).", w->hostname, w->addrport);
t->time_when_done = timestamp_get();
return 0;
break;
case VINE_APP_FAILURE:
/* task reaped in handle_failure */
debug(D_VINE, "Failed to receive output from worker %s (%s).", w->hostname, w->addrport);
break;
case VINE_SUCCESS:
reap_task_from_worker(q, w, t, VINE_TASK_RETRIEVED);
break;
case VINE_END_OF_LIST:
/* nothing to do, sentinel */
break;
}
delete_uncacheable_files(q, w, t);

delete_uncacheable_files(q, w, t);
/* if q is monitoring, update t->resources_measured, and delete the task
* summary. */
if (q->monitor_mode) {
Expand All @@ -1327,7 +1339,6 @@ static int fetch_outputs_from_worker(struct vine_manager *q, struct vine_worker_
vine_accumulate_task(q, t);

// At this point, a task is completed.
reap_task_from_worker(q, w, t, VINE_TASK_RETRIEVED);
vine_manager_send(q, w, "kill %d\n", t->task_id);

switch (t->result) {
Expand Down Expand Up @@ -1456,12 +1467,19 @@ this is due to an application-level issue or a problem with the worker alone.

static void handle_failure(struct vine_manager *q, struct vine_worker_info *w, struct vine_task *t, vine_result_code_t fail_type)
{
if (fail_type == VINE_APP_FAILURE) {
switch (fail_type) {
case VINE_APP_FAILURE:
handle_app_failure(q, w, t);
} else {
break;
case VINE_MGR_FAILURE:
case VINE_WORKER_FAILURE:
handle_worker_failure(q, w);
break;
case VINE_SUCCESS:
case VINE_END_OF_LIST:
/* nothing to do, these are not failures. */
break;
}
return;
}

/*
Expand Down
Loading