Skip to content

Commit

Permalink
DAOS-14788 container: refine task process in pmap_refresh_cb
Browse files Browse the repository at this point in the history
should register completion callback before task reinit, or the complete
cb possibly cannot be triggered.
(issue reported by Zhao Zhen <[email protected]>)

Required-githooks: true

Signed-off-by: Xuezhao Liu <[email protected]>
  • Loading branch information
liuxuezhao committed Dec 13, 2023
1 parent bcf8769 commit 466f5c7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/container/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,14 +668,6 @@ pmap_refresh_cb(tse_task_t *task, void *data)
else
delay = 0;

rc = tse_task_reinit_with_delay(task, delay);
if (rc) {
D_ERROR(DF_UUID": pmap_refresh version (%d:%d), resched"
" failed, "DF_RC"\n", DP_UUID(pool->dp_pool),
pm_ver, cb_arg->pra_pm_ver, DP_RC(rc));
goto out;
}

rc = tse_task_register_comp_cb(task, pmap_refresh_cb, cb_arg,
sizeof(*cb_arg));
if (rc) {
Expand All @@ -686,6 +678,14 @@ pmap_refresh_cb(tse_task_t *task, void *data)
goto out;
}

rc = tse_task_reinit_with_delay(task, delay);
if (rc) {
D_ERROR(DF_UUID": pmap_refresh version (%d:%d), resched"
" failed, "DF_RC"\n", DP_UUID(pool->dp_pool),
pm_ver, cb_arg->pra_pm_ver, DP_RC(rc));
goto out;
}

cb_arg->pra_retry_nr++;
D_DEBUG(DB_TRACE, DF_UUID": pmap_refresh version (%d:%d), "
"in %d retry\n", DP_UUID(pool->dp_pool), pm_ver,
Expand Down

0 comments on commit 466f5c7

Please sign in to comment.