-
Notifications
You must be signed in to change notification settings - Fork 29
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
RabbitHub httpc error on POST to Callback URL (socket_closed_remotely) #5
Comments
Gregg, Probably best to ping me directly at brett.r.cameron@gmail.com. In terms of the problem, are you by any chance using Apache? Reason I ask is that by default Apache sets MaxKeepAliveRequests to 100, which seems suspiciously close to your 99-101 range. It certainly looks like the web server is chopping the connection, and it's a fair bet that it's HTTP keepalive-related (after some maximum number of requests from a given client the connection is being closed by the web server). Your idea of setting max_keep_alive_length seems reasonable; however I this parameter pertains to the maximum number of outstanding (in-flight) requests on the same connection as opposed to the maximum number of (completed) requests (within a given period) before the connection is reset. As a test, are you able to set MaxKeepAliveRequests (or whatever is appropriate for the web server in question) to 0 or some other value and see whether this changes the situation? I have seen reports of issues with the Erlang HTTP client and keepalives, but would need to do a bit more digging. Certainly other RabbitHub users have not reported seeing this behavior, but I'm not sure what web server(s) they're using. For what it's worth, Tony's original code had a simple and effective hand-rolled HTTP client, which established a fresh connection for each request, but I switched to the Erlang client to provide a bit more functionality (like support for HTTPS). Regards, |
Hi Brett, We have decided to use Rabbitmq and Rabbithub and am now looking at a couple of enhancements for Rabbithub. I just finished my first try at erlang and am attaching my new rabbithub_web.erl to see if the way I added an endpoint to retrieve a list of subscriptions is ok.
Closed #5.— |
We are using the RabbitHub Rabbitmq plugin (https://github.com/brc859844/rabbithub) and experiencing the following issue:
When a queue is pre-populated (say 1000 msgs) then a subscriber is created, or when the publishing volume is sufficiently higher than the subscriber callback rate, each subscriber POST's 99 messages to the callback URL then gets the following error
=ERROR REPORT==== 12-Apr-2016::17:47:51 ===
RabbitHub post error
{rabbithub_consumer,http_post_failure,socket_closed_remotely,{}}
=INFO REPORT==== 12-Apr-2016::17:47:51 ===
RabbitHub stopping consumer, normal
{state,{rabbithub_subscription,{resource,<<"/">>,queue,<<"foo">>},
If we re-up the subscription then the same pattern happens again, 99 msgs are POSTed to the callback URL then we get the same error. The error is per subscriber as I setup 2 queues, 1 with 1 subscriber, 1 with 2 subscribers each with a unique callback URL and each callback URL received 99 msg's then the error occurred for each subscriber.
We tried another server with similar situation and the number was as consistent, but always failed between 98-101 messages.
The backend server hosting the callback does not seem to be the issue, we can hit it directly with a load much higher than what RabbitHub is sending with no issues at all.
Based on some forum posts on the socket_closed_remotely error we tried the following rabbitmq.config
{rabbithub, [
{max_pipeline_length, 0}, {max_sessions, 0}
Thanks
Gregg
The text was updated successfully, but these errors were encountered: