Skip to content
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

Add configurable backoff #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

LostKobrakai
Copy link
Collaborator

No description provided.

lib/sink/connection/client.ex Outdated Show resolved Hide resolved
def handle_info({:ssl_error, reason}, state) do
{:stop, {:error, reason}, state}
def handle_info({closed, _}, state) when closed in [:tcp_closed, :ssl_closed] do
if State.disconnecting?(state) do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want to think about this the other way: if the connection was closed when the connection state was :requesting_connection then we have a pretty good guess (though this is still a bit of a hack) that the server rejected the connection.

Copy link
Collaborator Author

@LostKobrakai LostKobrakai Mar 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that's a reasonable assumption to make. It could just as much be caused by a network or application issue while sink is in that state. Getting a negative connection response should be the reason for sink to consider itself being rejected. Any negative connection response will result in State.disconnecting?(state) being true.

I don't think penalizing a nova on bad network with a 5 minutes timeout would be a good idea and we should rather expect that connection responses are actually received if the nova is not already having a hard time keeping the connection open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants