-
Notifications
You must be signed in to change notification settings - Fork 190
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
send_req returns {:error, :retry_later} #147
Comments
Agreed. But I don't think anything can be done about this issue. If your server is always closing the connection after each response, then you have to spawn a new connection for each request. This can be done in a couple of ways:
Do you have any other suggestion? |
It affects all HTTP/0.9 servers too. is_connection_closing("HTTP/0.9", _) -> true;
is_connection_closing(_, "close") -> true;
is_connection_closing("HTTP/1.0", "false") -> true;
is_connection_closing(_, _) -> false. I'm not sure whether it is correct fix but for my purposes (communicating with chromedriver) I just remove following code handle_call({send_req, _}, _From, #state{is_closing = true} = State) ->
{reply, {error, connection_closing}, State}; |
That can't be the correct fix. What you are doing by removing that function clause is accepting a request and sending it on a connection which the server has indicated it will be closing after the end of response for the request it is already handling. As I mentioned in my initial response, the way to work around this situation is to explicitly spawn a connection and then use it for sending a request. The load balancing in ibrowse is designed to support pipelining, which doesn't exist in HTTP/1.0. |
It happens because find_best_connection returns already closed connection.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: