Review report

bitcoin/bitcoin: PR #36204

1 minor finding · 1 suggestion

Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.

Findings

Link

[minor] · I/O deadline test can fail when timer updates follow the clock advance

If the I/O thread pauses after publishing the final reply bytes, the test can advance mock time before both timer updates, leaving the disconnect wait unable to finish.

Location: src/test/httpserver_tests.cpp:1063 (head).

Details and suggested fix

Receiving the full reply does not establish that the I/O thread has finished its send bookkeeping. DynSock::Send() publishes bytes before MaybeSendBytesFromBuffer() updates m_idle_since, and RestartRequestDeadline() runs later still. If the I/O thread pauses across the test's 10 ms sleep and one-time clock advance, both timestamps can take the advanced mock time. The clock then stays fixed, neither timeout expires, and the assertion fails after roughly 60 seconds. This also bypasses InterruptNet() and JoinSocketsThreads(), leaving a joinable server thread during destruction. Advance mock time inside the disconnect wait loop so a late timer update cannot prevent eventual expiry. The required scheduling stall is possible, but its frequency has not been measured.


Optional improvements

Link

[suggestion] · Completion deadline also limits progressing body uploads

At the default timeout, a standalone RPC upload still incomplete after about 30 seconds can be disconnected despite continuous progress; real-workload impact is unconfirmed.

Location: src/httpserver.cpp:1115 (head).

Details and suggested fix

m_request_since remains armed until LoadBody() finishes, so later reads cannot extend the upload budget. With no earlier response pending, the send-side restart does not apply. A valid body still arriving when the deadline check expires therefore loses its connection without an HTTP error response, unlike the previous inactivity-only behavior. The allowed 32 MiB body needs roughly 1.1 MiB/s to fit the default budget. Raising -rpcservertimeout permits slower uploads but also relaxes inactivity reclamation; zero disables both checks. Total-time semantics may be intended, but document this compatibility change in the option help and release notes. If slow multi-MB uploads must remain supported, retain the fixed header deadline and use a bounded body-progress policy rather than leaving body trickling unlimited. No data on real RPC upload sizes or link speeds was found, so practical impact remains unconfirmed.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.