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
Reviewers: #bitcoin_abc, sdulfari
Reviewed By: #bitcoin_abc, sdulfari
Subscribers: sdulfari
Differential Revision: https://reviews.bitcoinabc.org/D13182