Skip to content

Conversation

gmaxwell
Copy link
Contributor

This avoids a regression for issues like #334 where high speed
repeated connections eventually run the HTTP client out of
sockets because all of theirs end up in time_wait.

Maybe the trade-off here is suboptimal, but if both choices will
fail then we prefer fewer changes until the root cause is solved.

This avoids a regression for issues like #334 where high speed
 repeated connections eventually run the HTTP client out of
 sockets because all of theirs end up in time_wait.

Maybe the trade-off here is suboptimal, but if both choices will
 fail then we prefer fewer changes until the root cause is solved.
@jgarzik
Copy link
Contributor

jgarzik commented Jan 16, 2015

ACK

@laanwj
Copy link
Member

laanwj commented Jan 16, 2015

utACK

@gmaxwell
Copy link
Contributor Author

Lets see if this breaks the tests expectations.

@jonasschnelli
Copy link
Contributor

Http basics.py test will fail.
I'll fix this soon and supply a commit.

@jonasschnelli
Copy link
Contributor

@gmaxwell if you pull in jonasschnelli@660d6ce travis will be happy. I also changed the HTTP method from GET to POST which is the correct method for JSON RPC.

@laanwj laanwj mentioned this pull request Jan 18, 2015
5 tasks
@laanwj laanwj merged commit 1a25a7e into bitcoin:master Jan 19, 2015
laanwj added a commit that referenced this pull request Jan 19, 2015
1a25a7e [QA] fix httpbasic keep-alive test (Jonas Schnelli)
7d2cb48 Restore RPC HTTP keepalives to default. (Gregory Maxwell)
gmaxwell added a commit that referenced this pull request Jan 19, 2015
This avoids a regression for issues like #334 where high speed
 repeated connections eventually run the HTTP client out of
 sockets because all of theirs end up in time_wait.

Maybe the trade-off here is suboptimal, but if both choices will
 fail then we prefer fewer changes until the root cause is solved.

Rebased-From: 1a25a7e 7d2cb48
Github-Pull: #5674
@laanwj
Copy link
Member

laanwj commented Jan 19, 2015

Backported into 0.10 branch as 186a517

@laanwj laanwj added this to the 0.10.0 milestone Jan 19, 2015
wtogami pushed a commit to litecoin-project/litecoin that referenced this pull request Jan 23, 2015
This avoids a regression for issues like #334 where high speed
 repeated connections eventually run the HTTP client out of
 sockets because all of theirs end up in time_wait.

Maybe the trade-off here is suboptimal, but if both choices will
 fail then we prefer fewer changes until the root cause is solved.

Rebased-From: 1a25a7e 7d2cb48
Github-Pull: bitcoin#5674
laanwj added a commit to laanwj/bitcoin that referenced this pull request Sep 3, 2015
- *Replace usage of boost::asio with [libevent2](http://libevent.org/)*.
boost::asio is not part of C++11, so unlike other boost there is no
forwards-compatibility reason to stick with it. Together with bitcoin#4738 (convert
json_spirit to UniValue), this rids Bitcoin Core of the worst offenders with
regard to compile-time slowness.

- *Replace spit-and-duct-tape http server with evhttp*. Front-end http handling
is handled by libevent, a work queue (with configurable depth and parallelism)
is used to handle application requests.

- *Wrap HTTP request in C++ class*; this makes the application code mostly
HTTP-server-neutral

- *Refactor RPC to move all http-specific code to a separate file*.
Theoreticaly this can allow building without HTTP server but with another RPC
backend, e.g. Qt's debug console (currently not implemented) or future RPC
mechanisms people may want to use.

- *HTTP dispatch mechanism*; services (e.g., RPC, REST) register which URL
paths they want to handle.

By using a proven, high-performance asynchronous networking library (also used
by Tor) and HTTP server, problems such as bitcoin#5674, bitcoin#5655, bitcoin#344 should be avoided.

What works? bitcoind, bitcoin-cli, bitcoin-qt. Unit tests and RPC/REST tests
pass. The aim for now is everything but SSL support.

Configuration options:

- `-rpcthreads`: repurposed as "number of  work handler threads". Still
defaults to 4.

- `-rpcworkqueue`: maximum depth of work queue. When this is reached, new
requests will return a 500 Internal Error.

- `-rpctimeout`: inactivity time, in seconds, after which to disconnect a
client.

- `-debug=http`: low-level http activity logging
reddink pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this pull request May 27, 2020
This avoids a regression for issues like litecoin-project#334 where high speed
 repeated connections eventually run the HTTP client out of
 sockets because all of theirs end up in time_wait.

Maybe the trade-off here is suboptimal, but if both choices will
 fail then we prefer fewer changes until the root cause is solved.

Rebased-From: 1a25a7e 7d2cb48
Github-Pull: bitcoin#5674
(cherry picked from commit 186a517)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants