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

avoid aggressive socket connection error callback #9

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

jayjlu
Copy link
Collaborator

@jayjlu jayjlu commented Apr 11, 2024

Avoid aggressive socket connection error callback and some javadoc fix.

    public void onClose(ConnectorSocket socket, Throwable error) {
        runningSockets.remove(socket);
        idleSockets.remove(socket);
        if (error == null) {
            addAnyMissing();
        } else {
            // if error, adding back sockets with backoff
            addAnythingMissingWithBackoff(); 
        }
    }

The majority change is here. this onClose() method will be invoked for normal close and error close. we want to make sure it done the backoff when error happened (at least do the reconnect with backoff start from 502 ms till 10 second) .

@flowerdhsbc flowerdhsbc merged commit 41294c7 into master Apr 11, 2024
6 checks passed
@flowerdhsbc flowerdhsbc deleted the retry-backoff-on-connection-error branch April 11, 2024 01:48
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