Page MenuHomePhabricator

util: Handle HTTP_SERVICE_UNAVAILABLE in bitcoin-cli
ClosedPublic

Authored by PiRK on Feb 27 2023, 16:50.

Details

Reviewers
sdulfari
Group Reviewers
Restricted Project
Commits
rABC36613b39a363: util: Handle HTTP_SERVICE_UNAVAILABLE in bitcoin-cli
Summary

If bitcoind is processing 16 RPC requests, attempting to submit another request using bitcoin-cli produces this less-than-helpful error message: error: couldn't parse reply from server. This PR changes the error to: error: server response: Work queue depth exceeded.

This is a backport of core#18335 and core#21484

Test Plan
$ src/bitcoind -rpcworkqueue=1 -daemonwait=1
$ sleep 10
$ seq 10 | while read i;do src/bitcoin-cli getblockchaininfo  >/dev/null&done
error: Server response: Work queue depth exceeded
error: Server response: Work queue depth exceeded
$ src/bitcoin-cli stop

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Feb 27 2023, 16:50
test/functional/interface_rpc.py
98 ↗(On Diff #38077)

I suspect that using multiple threads here does not achieve anything, due to python's limitations with multithreading. But it does not hurt either, and maybe a future version of python will actually be able to do proper multithreading.

sdulfari requested changes to this revision.Feb 27 2023, 18:41
sdulfari added a subscriber: sdulfari.
sdulfari added inline comments.
src/httpserver.cpp
284 ↗(On Diff #38077)

As pointed out in the original PR this deserves a release note.

This revision now requires changes to proceed.Feb 27 2023, 18:41
PiRK edited the summary of this revision. (Show Details)

add a release note (backport of core#21484)

This revision is now accepted and ready to land.Feb 28 2023, 16:47
Unknown Object (User) added a subscriber: Unknown Object (User).Mar 1 2023, 16:58