Skip to content

Calling Stop() on Initiator blocks on Dial method #653

Closed

Description

@abronan

When calling Start() and then Stop() on the initiator with a connection that is failing or timing out, sending a SIGTERM prevents the program from exiting because of the call to Dial in handleConnection.

Reducing the SocketTimeout to a lower value mitigates this issue, since the call to Dial will exit early and then exit when checking on the stopChan in waitForReconnectInterval. However this is not a clean solution and prevents flexibility from consumers of the library to be able to stop the connect process immediately.

The reason why is that the handleConnection method is taking in a proxy.Dialer which doesn't contain a dialer.DialContext method required to cancel the connection mid-way with a cancellation signal.

As a solution, we can cast the proxy.Dialer to a proxy.ContextDialer and let the call to Stop() properly exit the connection process with the use of a context on handleConnection.

Activity

  1. added a commit that references this issue on May 20, 2026
    fdd8ed6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions