fix(libSceHttp2): retry a failed lookup the number of times sceHttp2SetResolveRetry sets #11617
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11617"
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 boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-26T22:56:55Z.
What
With #11616, MXGP 26 (PPSA30839) gets past
sceHttp2GetMemoryPoolStatsand exits 8 s after launch:sceHttp2SetResolveRetrythrows for any nonzero count. MXGP sets the count it keeps in its HTTP module's state on each template; Super Meat Boy 3D (PPSA31162) makes the same call. The count only matters when a lookup fails, and a failed lookup still throws here because its console error mapping is unknown. So the change is to keep the count and try the lookup up to that many more times before failing.Call sites (the 25 bytes ending at each call's opcode occur once in the title's
eboot.bin): MXGP 26 01.003.000 at 0x13A3B40, Super Meat Boy 3D 02.000.001 at 0x14123AC.How
Transport.hpp:SettingsgainsresolveRetry, so a request copies it from its template like the other settings.Export.cpp:sceHttp2SetResolveRetrystores the count. A negative count still throws, since what the console does with one is not known.Transport.cpp:Connectsubmits the lookup up toresolveRetry + 1times, each attempt with its own resolve deadline. It rethrows the last failure only after the final attempt.GuestHttp2.cpp: a count of 3 now returns 0 and -1 throws.Transport.cpp's resolver worker calls an optional lookup hook beforegetaddrinfo; a nonzero return fails that lookup.Export.cppexports the hook setter asHttp2SetLookupHook_nid_no_patch, since the transport is a static library with hidden symbols.GuestHttp2Transport.cpp, newRetriesscenario with a counting hook:count + 1lookups.docs/dev/debt/libSceHttp2.md: the TLS-settings entry now lists negative resolve retries as throwing and says what a count does.Merge order. Checked with
git merge-tree --write-treeagainst the current heads (#11575d847910c69, #11611b5eebed6ca, #10536):CreateRequest_nid_no_patch, whose signature #11575 changes. The hook now lives at the top ofTransport.hpp, andTransport.cpponly gains the hook call and the retry loop.docs/dev/debt/libSceHttp2.md. Each rewrites other parts of that same line. Whichever lands second keeps the other's wording and these two PRs' sentences: the pool-stats sentence from #11616 and the resolve-retry clause from this PR.Tested
main52c09d567d(MarcZX10's review): headd07f750857.main's request-options entry is kept in the debt file, and this PR's sentences replace only the resolve-retry ones. The 7 tests matching^guest_http2pass 3 of 3.Linux (Ubuntu 26.04.1, GCC 15.2), Release.
fe32b2a3c3, before the field move and the retry test. On this headcac330cff3,guest_http2,guest_http2_transportandguest_memory_pool_statspass 3 of 3.52fd5f42aa(same loop and test as this head) withConnectback to a single lookup failsguest_http2_transportin the firstRetriescase: the send throwssceHttp2: DNS failedafter the first failed lookup.Export.cppabort inguest_http2withsceHttp2SetResolveRetry not implemented.APS5_PAD_INPUT_FILE.fe32b2a3c3) it passessceHttp2SetResolveRetryand exits at 7 s on the next call,sceHttp2SetRedirectCallback not implemented.sceHttp2SendRequestAsync not implemented. Async requests are unimplemented onmain.guest_http2,guest_http2_transportandguest_memory_pool_statspass 3 of 3 on bothmain74acfad65band52fd5f42aa, the head before the hook moved to the header, including the hook exported fromlibSceHttp2.dll; the run of this head is in a comment below.tools/check_conventions.py --base upstream/mainpasses.God of War Ragnarök (PPSA08329 06.006.000), run by B-Howell on Windows 11 with an RTX 4080 SUPER (617.42), WinLibs GCC 15.2, Release: on
mainthe title aborts 5 s after start withsceHttp2SetResolveRetry not implemented, with a non-zero retry count. With this PR (b5991e402fmerged ontomain6e9b9134f6) it gets past that point and runs 150 s, to an unrelated AGC stop. None of 8 runs with this PR stopped in libSceHttp2.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)sceHttp2SetResolveRetrystop (PPSA31162 #9268 makes the same call, not run)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T23:00:08Z.
Review: CHANGES_REQUESTED
Reviewed exact head
ee263a89964809faf2b0504ee46327db9aec56ed. Changes requested: exercise the retry path. The new transport test setsresolveRetry=2on successful localhost lookups, so it only covers the first successful attempt. It would still pass ifConnect()ignored the setting or never resubmitted a failed lookup. Please add a deterministic resolver test (for example, an injectable/counting lookup stub that fails once then succeeds, plus an exhausted-retry case) and assert the total lookup count isretry + 1. The loop inConnect()is the behavior this PR adds, so the current setter test and successful lookup scenarios do not validate it.The dependency on #11616 is accurately declared; the hosted eligibility, conventions, intake, labels and report checks pass. Build/relinker/product checks are skipped by path policy. The author reports the focused Linux HTTP/2 tests and title progress, but neither forces a failed DNS lookup followed by a retry.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T02:04:34Z.
Review: DISMISSED
Re-reviewed exact head
52fd5f42aa9116715126ba85d7104f24f7bcfd00. The new deterministic retry tests resolve my earlier request: they verify two failed lookups followed by success, and exhaustion after exactly retry-count + 1 attempts. Localgit diff --checkandtools/check_conventions.py --base upstream/main --head refs/review/11617pass. I did not rerun the guest tests; the author reports the focused groups passing on Linux and Windows.[P2] Resolve the current HTTP/2 integration conflicts and list the required order. I checked the current PR heads with
git merge-tree --write-tree. #11617 merges cleanly with its declared base #11616, and #11575 merges cleanly with #11616; however, #11575 + #11617 conflict incore/libs/prx/libSceHttp2/Transport.cppandTransport.hpp. #11611 + #11617 conflict in those two files anddocs/dev/debt/libSceHttp2.md. The PR description currently says #11575 merges cleanly with #11617, which does not match these current-head results, and its Depends on line lists only #11616.Please coordinate the merge order with #11575 and #11611, update the overlap statement, and record the dependencies/order needed to carry the retry change through those transport changes. I am not asking either contributor to close their work; the branches need an explicit integration plan before this can be approved.
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T04:16:52Z.
Review: APPROVED
Reviewed — approved
The change merges cleanly onto current
main. It builds, the libSceHttp2 tests pass 3 of 3, and the newRetriesscenario fails whenConnectgoes back to a single lookup. Nothing is blocking. Two notes on the debt entry are below.What I ran
b5991e402f5c6a053e914ab241edb656e10f5755main:b433c40f2f46aa2e59e19806010a839ac8572d64(#11616 is already merged into it, so the merged diff is only this PR's 6 files;GuestMemoryPoolStats.cppno longer differs)Results
mainExport.cpp,Transport.cpp, both tests and the debt file)git diff --checkcheck_conventions.py --base origin/mainAll conventions checks passed.libsguest_http2,guest_http2_cookies,guest_http2_options,guest_http2_transport,guest_http2_early_response,guest_http2_system_roots,guest_http2_teardown,guest_memory_pool_statsguest_http2_transport5.4–5.6 s, well under its 30 s limitRetriesscenario reachedHTTP2 resolve retry scenariosappears in the-Vlogctest, one of the three runs
Negative control
Each control was run on the merged tree, and the files were restored afterwards. All 7
guest_http2*tests passed again after the restore.Export.cpp,Transport.cppandTransport.hpprestored frommain.guest_http2_transport_testsdoes not compile becauseHttp2SetLookupHook_nid_no_patchis not declared.guest_http2, rebuilt on its own, aborts withwhat(): sceHttp2SetResolveRetry not implemented.if (attempt >= settings.resolveRetry) std::rethrow_exception(...)with an unconditional rethrow and kept the hook.guest_http2_transportaborts in the firstRetriescase:This confirms what MarcZX10 accepted in their second review: the test exercises the retry path. It matches the author's own control.
Findings
Blocking
None.
Non-blocking
The retry semantics are a host-side choice, but the debt entry does not say so.
docs/dev/debt/libSceHttp2.md:33says "a failed lookup is retried up to the set count". It does not say this is unverified. Onmain, the libSceNet resolver'sretryargument (docs/dev/debt/libSceNet.md:70) suggests the console count may mean DNS query retransmissions within one resolve timeout, not whole new lookups after a failure. Two consequences of the choice incore/libs/prx/libSceHttp2/Transport.cpp:328-338are not recorded:resolveTimeoutdeadline (line 329), so a request with count N can wait up to (N + 1) × the resolve timeout.Check(deadline)and is not retried. Only a lookup that completes with a failure is.Per CONTRIBUTING ("an entry states the gap first … what is unverified"), please record this. The TLS-settings entry is at 981 characters, so one short sentence fits better in the error-paths entry at line 32. For example: "Resolve retries resubmit a failed lookup, each with its own resolve timeout; timed-out lookups are not retried, and the console's retry semantics are unverified."
The production code now has a test seam.
Http2SetLookupHook_nid_no_patch(core/libs/prx/libSceHttp2/Export.cpp:385) and the atomic load per lookup (Transport.cpp:166) are new. The cost is negligible, andGuestArena::GuestArenaSetHostReadHook_nid_no_patchis a precedent onmain, so I see no change needed. I mention it so a maintainer can confirm the pattern is wanted here.Not verified
libSceHttp2.dll(the author reports passing runs on a Windows VM).git merge-treeagainst them.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T04:32:58Z.
Review: APPROVED
Re-checked — approved
The only change since my last review is
3eae6e67ea, a one-sentence addition to the libSceHttp2 error-paths debt entry. It resolves my first note, and the code and tests have not changed.What changed since my last review
3eae6e67ea7f85157706c28665356fdd108294dc, on top ofb5991e402f. It touches onlydocs/dev/debt/libSceHttp2.md(1 line changed).git diff b5991e402f 3eae6e67ea -- coreis empty.What I ran
3eae6e67ea7f85157706c28665356fdd108294dcmain:b433c40f2f46aa2e59e19806010a839ac8572d64. This is the samemainas my previous review, so the merged code is identical to the tree I built and tested then.I did not rebuild or rerun tests, because no code, test or build file changed.
maingit diff --checkcheck_conventions.py --base origin/mainAll conventions checks passed.Previous findings
The debt entry did not say the retry semantics are a host-side choice. Resolved.
docs/dev/debt/libSceHttp2.md:18now ends: "A resolve retry resubmits a failed lookup with a new timeout; a timed-out lookup isn't retried. The console's retry semantics are unverified."I checked this sentence against
Transport.cpp:328-338, and it matches the code:Deadline(settings.resolveTimeout).Check(deadline)before the retry test is reached.job->failureset loops again.The production code has a test seam (
Http2SetLookupHook_nid_no_patch). No longer applies. This was a note for maintainers with no change requested, and the author left the hook as it is.New findings
Blocking
None.
Non-blocking
None.
Not verified
Retriesnegative control failing.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T05:20:31Z.
Review: CHANGES_REQUESTED
Re-checked — changes requested
The prior review evidence supports the retry-count behavior and the documented title stops, but current
mainhas since changed every source/test/debt path this PR touches; the last reported run is on an older integration and needs to be repeated after refreshing the branch.What I ran
3eae6e67ea7f85157706c28665356fdd108294dcwith currentmain52c09d567d2fa453494dd720fcf53a98149468e4.Results
ab69af1ffd...a45f140d85eaf787a199015712029f9231bb802e; current main is much newerExport.cpp,Transport.cpp,GuestHttp2.cpp,GuestHttp2Transport.cpp, anddocs/dev/debt/libSceHttp2.mdguest_http2passes 3/3 and theRetriesscenario fails when retry is changed back to one lookup; based on mainb433c40f2f46aa2e59e19806010a839ac8572d64Raw output
Negative control
Connectto a single lookup makes theRetriesscenario fail. I did not rerun it on the current-main tree.Findings
Blocking
b433c40f2f46aa2e59e19806010a839ac8572d64), while currentmainchanged both implementation files, both related test files and the debt entry. The merge preview is clean, but this retry change and its current test interactions have not been verified on the integrated tree. Please refresh the branch and rerunguest_http2and the relevant transport tests, plus conventions, on the new exact head.Non-blocking
Sources
Not verified
main; the cited results come from another reviewer on an older integration. No title was run locally.To get this to a good state
Rebase onto current
main, rerun the HTTP/2 retry and transport tests plus conventions, and update Tested with the exact head/base and results. Then the earlier behavior and debt feedback can be cleared.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T06:38:48Z.
Review: APPROVED
Re-reviewed — approved
I reviewed exact head
d07f750857d8f43157bfcc798d61982f4e7c9c6dagainst currentmain2960e9a6e7e1fc99c4ed180c71495b5eb83464c7.What I ran
git merge-tree --write-tree refs/remotes/upstream/main refs/review/upstream-11617; it returned clean treec777d60cec8e12c2261d76c914840a9fe8ddc745.git diff --check refs/remotes/upstream/main...refs/review/upstream-11617; exit 0, no output.52c09d567dand currentmain; there are none.Results
^guest_http2tests passing 3/3 on Ubuntu 26.04.1 / GCC 15.2 after the rebaseConnectis restored to one lookup; not rerun on this headNegative control
I did not run the negative control locally. The earlier reviewer-reported control remains applicable: changing the retry loop back to one lookup makes the retry scenario fail. The production and test changes are present in this rebased head, and the author reports the focused suite on this exact head.
Findings
Blocking
None. The branch now includes the mainline changes to all touched paths, preserves current-main debt text, and has a clean merge preview. The refreshed focused test result addresses my previous integration request.
Non-blocking
The console's mapping for a failed DNS lookup remains explicitly unverified in the debt entry; the PR does not claim that behavior is measured.
Sources
Not verified
I did not independently rebuild or run the HTTP/2 suite, run a title, or reproduce a failed lookup followed by a successful retry. The exact-head focused tests are author-reported; the current-main path comparison and merge/diff checks were run locally.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T23:51:29Z.
Review: APPROVED
Re-checked — new head, looks good
The retry-count logic and deterministic failure/success cases remain in the current diff; the new header-based hook keeps the resolver and test seam on the same atomic slot.
What I ran
4e921aa0e302fb59053a4925718c0a7242def62a; PR base and currentmain:1189ec3003672bb364dd9f3119ead7b3976e3c83.7fd72e0a24fbec617aa2d591493c865dfb95f2bc.Results
git diff --checkretry + 1; not run locallyUnedited local command output
Not verified
I did not build or run the HTTP/2 tests locally. The author-reported focused tests are tied to the earlier
d07f7508head; the current hosted Windows job is queued. I found no source-level issue in the current retry loop or its test seam that requires delaying approval.Sources