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

[BUG] setting reconnectInterval to 0 does not disable reconnects #12

Closed
blueid-mathias-henze opened this issue Jan 18, 2018 · 2 comments
Assignees
Labels

Comments

@blueid-mathias-henze
Copy link

In de.siegmar.logbackgelf.GelfTcpAppender, the documentation for reconnectInterval says:

Time interval (in seconds) after an existing connection is closed and re-opened.
A value of 0 disables automatic reconnects. Default: 300 seconds.

but the implementation checks for < 0, so effectively reconnects on every message:

    private void connect() throws IOException {
        closeOut();

        final Socket socket = getSocket();
        outputStream = socket.getOutputStream();

        nextReconnect = reconnectInterval < 0
            ? Long.MAX_VALUE
            : System.currentTimeMillis() + (reconnectInterval * SEC_TO_MSEC);
    }
@osiegmar
Copy link
Owner

Thanks! This has already been fixed in the connection-pool branch which is supposed to be released shortly.

@osiegmar osiegmar self-assigned this Jan 19, 2018
@osiegmar osiegmar added the bug label Jan 19, 2018
@osiegmar
Copy link
Owner

fixed in 1.1.0 which has just been released

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

No branches or pull requests

2 participants