Repository navigation
Conversation
A zero-copy request on a failover endpoint restarts when one of its operations completes with an error. The completion releases the registered memory of the request before the restart, and the restart registers it again. Add test_ucp_fault_tolerance_iov.zcopy_restart: an IOV put or get of eight 1 MB elements is posted again right after a lane which its protocol sends on is invalidated, so its fragments on that lane complete with an error and the request restarts on the remaining lanes. The request must complete and its data must arrive. It fails now: the restart uses the array of IOV memory handles which the completion freed.
ucp_datatype_iter_iov_cleanup() freed the array of IOV memory handles, but left the pointer to it. A zero-copy request which restarts after an operation error is cleaned up by its completion first. The reset of the restart then deregistered the handles in the freed array again, the next registration reused the freed array, and the final cleanup freed it a second time. Reset the pointer after the free, as the contiguous and SGL cleanups already do, so the restart registers the buffers into a new array.
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 Review complete — no issues found. |
This branch has not been deployed
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.
What?
Reset the pointer to the IOV memory handle array after
ucp_datatype_iter_iov_cleanup()frees the array.Why?
On a failover endpoint, a zero-copy request whose operation fails is cleaned
up and then restarted. With
UCP_DATATYPE_IOVthe cleanup frees the memoryhandle array but keeps the pointer, so the restart passes this check,
deregisters handles from the freed array and then registers new ones into it:
ucx/src/ucp/dt/datatype_iter.inl
Lines 805 to 808 in cdc194b
The new test without the fix
How?
Set the pointer to NULL after the free, as the contiguous and SGL cleanups
do. The new test sends an IOV put or get once to find a lane of its protocol,
invalidates that lane on rc_x and sends the request again, so it restarts.