-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Enable http-keepalives/HTTP2 on JSON-RPC interface! #384
Conversation
Hmm I just tried it. I telnetted to it and hand-crafted the header & request.. After issuing it a few "server.pings" in succession I consistently get a panic. I also tried Fulcrum and it started the synch process only for bchd to also panic immediately. This is the stack trace each time, same trace:
|
Status update, appears to be working. No more panics. =) |
Awesome. One more thing not related to this change -- the other bitcoind's expect a boolean value for {"error":{"code":-8,"message":"Failed to parse request: parameter #2 'verbose' must be type int (got bool)"},"id":168,"jsonrpc":"1.0","result":null} Shall I open an issue for this? |
Oh.. I see. This is not an issue. I had the bitcoind |
Oh no.. my bad. Error still happens. Weird. So |
Wait, it panics or just returns an error? |
Yeah... |
So the only thing I am really worried about here is the panic's you reported that I can't replicate. I was curling my node and can't simulate any panics. If I pass the wrong type it complains but does not crash the process. Can you share a call that causes the panic? |
c617f38
to
c196d09
Compare
NOTE: there were no panics, @cculianu was just saying it threw an error. Nothing to worry about crashing wise. =) |
b1f6cee
to
d1da409
Compare
@zquestz Yeah sorry for using the |
BTW I have been running Fulcrum connected to bchd for hours now in a test and after setting the ping timer (on the Fulcrum side) to something like 3 seconds (paranoia).. it never drops conn now due to idle.. and it works very fast. This is off the latest commit as of the time of this writing: d1da409 I'm all-for this feature! |
Do you think there's a strong chance this change (or something equivalent) will make it into mainline bchd? I want to bullet-point in my next fulcrum release that "bchd support is ready!"... but I don't know if that's premature as of now. Thanks. |
Enable support for http-keepalive's on the JSON-RPC interface. In addition we gain HTTP2 support by getting rid of the hijack code!
I have tested this extensively and it works great with curl/wget/bchctl. I also was able to mitigate the issue that required the hijack code. By setting the
ReadHeaderTimeout
it can check the RPC auth and then allow an auth'd client to use theReadTimeout
for long poll requests.I also updated the code to use the built in http
CloseNotifier
.Fixes: #380