AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 35 Bitcoin

http: properly respond to HTTP request during shutdown

Public commit record

What the developer wrote

Authored by furszy

73/100 · Adequate
http: properly respond to HTTP request during shutdown

Makes sure we respond to the client as the HTTP request attempts to submit a task to
the thread pool during server shutdown.

Roughly what happens:

1) The server receives an HTTP request and starts calling http_request_cb().
2) Meanwhile on another thread, shutdown is triggered which calls InterruptHTTPServer()
and unregisters libevent http_request_cb() callback and interrupts the thread pool.
3) The request (step 1) resumes and tries to submit a task to the now-interrupted server.

This fix detects failed submissions immediately, and the server responds with
HTTP_SERVICE_UNAVAILABLE.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This change fixes a bug in Bitcoin Core's built-in web server (used by RPC and REST interfaces). During server shutdown, incoming HTTP requests could be accepted but then silently dropped because the worker thread pool had already been interrupted. The server would not send any response back to the client, causing the connection to hang until it timed out. The patch detects when a request cannot be queued and immediately replies with a '503 Service Unavailable' status, telling the client the server is shutting down.

Recommended action

Treat as a low-severity reliability/denial-of-service improvement. Backport to maintained release branches if shutdown-time RPC availability is a concern. No immediate emergency response is warranted; monitor for related hangs during planned shutdowns.

Security signals we found

01

Denial-of-service hardening: prevents shutdown-time RPC/REST requests from causing hung connections

02

Resource leak avoidance: unqueued requests are now explicitly finalized with an HTTP response

03

Thread-pool interruption race condition addressed

04

HTTP 503 Service Unavailable returned instead of silent connection drop

Risk score

Why this scored 35/100

Our methodology →
Potential impact 8/30
Exploitability 5/25
Stealth signal 4/15
Affected reach 7/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.