XAsync: a failing Begin fails the call, and E_PENDING does not complete #55
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/56"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by gefydev on 2026-11-22T23:03:07Z.
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.Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T09:45:15Z.
Merged (
daa27b0). Follow-up ine38cb65:XAsyncScheduleon a terminated queue returnsE_ABORTlikeXTaskQueueSubmitDelayedCallbackafter #57, so with this PR such anXAsyncRun/ XCL operation fails through the block and its work never runs (testasync_work_on_a_terminated_queue_is_aborted).Tested on Windows 11 (RX 9070):
cargo test --workspacegreen (lib 351, e2e), and a 45 s Unicorn Overlord run on the release build (VFS hooks active, ~60 fps, clean exit). Thanks!