Repository navigation
XAsync: a failing Begin fails the call, and E_PENDING does not complete - #56
Merged
Merged
Conversation
As in libHttpClient's AsyncLib.cpp: - XAsyncBegin returns S_OK when the provider's Begin fails: the call is completed with that error, and the caller gets it once, through the block. XCL returned the error as well, so a caller saw it both as the return value and in its completion. XAsyncRun likewise when its schedule fails. - XAsyncComplete with E_PENDING does nothing (the provider still has work to do). XCL completed the call with E_FAIL.
ivall
added a commit
that referenced
this pull request
Nov 23, 2026
Like XTaskQueueSubmitDelayedCallback since #57 (libHttpClient schedules through it): E_ABORT, so XAsyncRun / XCL's own operations on a terminated queue fail through the block (#56) and their work never runs. Test async_work_on_a_terminated_queue_is_aborted; the task queue module comment follows #54 / #57.
Collaborator
|
Merged (daa27b0). Follow-up in e38cb65: Tested on Windows 11 (RX 9070): |
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.
Two differences from libHttpClient's
AsyncLib.cppin howxasync.rsreports results:XAsyncBegin: when the provider's Begin fails, the call is completed with that error, and XCL also returned it fromXAsyncBegin. libHttpClient returnsS_OKthere: the caller gets the error once, through the block. A title that treats a failedXAsyncBeginas "nothing was started" and frees the block, or retries, does so on a block that was already completed (and whose completion callback may already be queued).XAsyncRunlikewise when its schedule fails.XAsyncComplete(b, E_PENDING, ...): libHttpClient returns without completing ("E_PENDING is special -- if you still have work to do don't complete"). XCL turned it intoE_FAILand completed the call, ending an operation the provider meant to keep running.Both now follow libHttpClient.
This is independent of #53 (which changes
XAsyncCancelin the same file); the two merge without conflicts.Validation
a_failing_begin_fails_the_call_not_xasyncbeginandcompleting_with_e_pending_does_not_complete. Onmainboth fail (XAsyncBeginreturnsE_FAIL; the status afterXAsyncComplete(E_PENDING)isE_FAILinstead ofE_PENDING).cargo test -p xcl --lib: 345 passed, 0 failed, on Windows GNU under Wine.