Repository navigation
Conversation
…e-init Destroying the client context at the top of daos_eq_lib_fini() left in-flight tasks with no way to make progress, so their completion callbacks re-entered a half-torn-down scheduler: the drain lost task references, cancelled tasks were unlinked without completing, and late bulk completions hit freed shards. Cancel and drain the global scheduler while the context can still run, then destroy the context. The remaining aborts came from the scheduler itself: it is a single static object reused across library generations, so a worker still waiting in daos_event_priv_wait() raced the next daos_eq_lib_init() re-initializing it in place. Give each generation its own scheduler object, keep the previous one allocated for stale waiters, reject submissions that race the final fini, and make the private event wait bail out when its scheduler was cancelled or the library generation changed underneath it. Also hold a CaRT group reference for the lifetime of an RPC and return -DER_NO_HDL instead of dereferencing a stale object handle in the transaction path, both of which the drain exposed. Fixes DAOS-19955, DAOS-19962 Signed-off-by: Jihyeon Gim <potatogim@potatogim.net>
|
Ticket title is 'Intermittent client abort at tse_task_decref assertion during dfs_fini teardown' |
Author
|
Closing in favor of a split: the drain-races layer (DAOS-19955) and the generation-scheduler layer (DAOS-19962) will be submitted as two stacked PRs, starting with #19525's base branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes DAOS-19955
Fixes DAOS-19962
The client aborts or hangs intermittently when dfs_fini() teardown races in-flight operations and an immediate re-initialization. This was reproduced with a standalone Go/cgo reproducer (connect, concurrent dfs I/O, teardown after 200 ms without joining the workers, re-init, repeat) against a 2.6.5 single-node docker deployment; 21 of 40 versitygw DAOS-backend suite runs aborted at the same tse_task_decref assertion during cleanup.
Two independent layers were involved. First, daos_eq_lib_fini() destroyed the CaRT context before draining the global scheduler, so in-flight tasks could no longer make progress: completion callbacks re-entered a half-torn-down scheduler, the drain lost task references, cancelled tasks were unlinked without completing, and late bulk completions touched freed shards. The drain now runs while the context can still progress, before the context is destroyed. Second, the global scheduler is a single static object reused across library generations, so a worker still inside daos_event_priv_wait() raced the next daos_eq_lib_init() re-initializing it in place, which showed up as destroyed-mutex aborts, EBUSY mutex destroy, or a permanent epoll spin. Each generation now gets its own scheduler object; the previous generation's object is kept allocated so stale waiters still see a valid, cancelled scheduler and bail out through a generation check in daos_event_priv_wait(). Submissions racing the final fini are rejected, and thread-private events from a previous generation are re-initialized.
The drain also exposed two smaller issues that are addressed here: an RPC did not hold a CaRT group reference for its lifetime, and the transaction path dereferenced a handle after -DER_NO_HDL.
With these changes the reproducer completes 50 teardown/reinit cycles repeatedly with no abort and no hang, where previously every run aborted or hung within tens of cycles.
Steps for the author:
After all prior steps are complete: