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

DAOS-7015 event: proper event handing in case of progress errors (#4911) #4961

Merged
merged 2 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
25 changes: 22 additions & 3 deletions src/client/api/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,7 @@ daos_event_priv_get(daos_event_t **ev)
if (evx->evx_status != DAOS_EVS_READY) {
D_CRIT("private event is inuse, status=%d\n",
evx->evx_status);
return -DER_BUSY;
}
*ev = &ev_thpriv;
return 0;
Expand All @@ -1243,12 +1244,30 @@ daos_event_priv_wait()

/* Wait on the event to complete */
while (evx->evx_status != DAOS_EVS_READY) {
int rc2;

rc = crt_progress_cond(evx->evx_ctx, 0, ev_progress_cb, &epa);
if (rc == 0)

/** progress succeeded, loop can exit if event completed */
if (rc == 0) {
rc = ev_thpriv.ev_error;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"rc" will be overwritten by the next crt_progress_cond() immediately, we might not need to save it?
The main behavior changed by this patch is, we originally exit from the loop for ev_thpriv.ev_error != 0, now we don't do that anymore, is this intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought that if the error is set, then the loop will exit anyway in the check?
maybe im wrong..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you're right though, we should exit the loop. i will fix this first on master.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created this PR.
#4981
will integrate into this 1.2 pr once that lands

if (rc)
break;
continue;
}

if (rc && rc != -DER_TIMEDOUT)
break;
/** progress timeout, try calling progress again */
if (rc == -DER_TIMEDOUT)
continue;

/*
* other progress failure; op should fail with that err. reset
* the private event first so it can be resused.
*/
rc2 = daos_event_priv_reset();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should never fail for private event, we might just assert it's zero.

D_ASSERT(rc2 == 0);
ev_thpriv_is_init = true;
break;
}
return rc;
}
Expand Down
6 changes: 5 additions & 1 deletion src/client/api/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ dc_task_schedule(tse_task_t *task, bool instant)

out:
if (daos_event_is_priv(ev)) {
daos_event_priv_wait();
int rc2;

rc2 = daos_event_priv_wait();
if (rc2)
return rc2;
rc = ev->ev_error;
}
return rc;
Expand Down