Skip to content

Failover mechanism is not working when connection is reset by peer on InitiatorΒ #402

Open
@esanchezros

Description

@esanchezros

Describe the bug
We have an initiator configured with 2 acceptors and it connects to them via an sTunnel service running locally:

SocketConnectHost=localhost
SocketConnectPort=44445
SocketConnectHost1=localhost
SocketConnectPort1=44446

If the first acceptor is offline, the initiator keeps on trying the first acceptor and never moves on to the failover ones.

To Reproduce

  • Configure the initiator with 2 acceptors using any IP address and port that accepts tcp traffic.
  • Start the initiator
  • The connection is attempted with the first acceptor, a logon attempt is made, the connection times out, the connection is disconnected (see the logs).
.l.a.c.f.a.Application                   : Adding logon details. Username TargetCompID
quickfixj.msg.outgoing                   : FIXT.1.1:SenderCompID/TargetCompID->MAIN: 8=FIXT.1.1|9=112|35=A|34=459|49=SenderCompID|50=TargetCompID|52=20210624-09:29:29.788|56=MAIN|98=0|108=30|553=TargetCompID|554=xxxxxxxx|1137=9|10=158|
quickfixj.event                          : FIXT.1.1:SenderCompID/TargetCompID->MAIN: Initiated logon request
quickfixj.errorEvent                     : FIXT.1.1:SenderCompID/TargetCompID->MAIN: Disconnecting: Socket exception (localhost/127.0.0.1:44445): java.io.IOException: Connection reset by peer
l.a.c.f.m.MonitoringSessionStateListener : onDisconnect: session FIXT.1.1:SenderCompID/TargetCompID->MAIN[in:461,out:460] disconnected
l.a.c.f.m.MonitoringSessionStateListener : onLogout: session FIXT.1.1:SenderCompID/TargetCompID->MAIN[in:461,out:460] logged out
l.a.c.f.m.MonitoringSessionStateListener : onConnect: session FIXT.1.1:SenderCompID/TargetCompID->MAIN[in:461,out:460] connected
quickfixj.event                          : FIXT.1.1:SenderCompID/TargetCompID->MAIN: MINA session created: local=/127.0.0.1:49158, class org.apache.mina.transport.socket.nio.NioSocketSession, remote=localhost/127.0.0.1:44445
.l.a.c.f.a.Application                   : Adding logon details. Username TargetCompID
quickfixj.msg.outgoing                   : FIXT.1.1:SenderCompID/TargetCompID->MAIN: 8=FIXT.1.1|9=112|35=A|34=460|49=SenderCompID|50=TargetCompID|52=20210624-09:29:59.785|56=MAIN|98=0|108=30|553=TargetCompID|554=xxxxxxxx|1137=9|10=150|
quickfixj.event                          : FIXT.1.1:SenderCompID/TargetCompID->MAIN: Initiated logon request
quickfixj.errorEvent                     : FIXT.1.1:SenderCompID/TargetCompID->MAIN: Disconnecting: Socket exception (localhost/127.0.0.1:44445): java.io.IOException: Connection reset by peer
l.a.c.f.m.MonitoringSessionStateListener : onDisconnect: session FIXT.1.1:SenderCompID/TargetCompID->MAIN[in:461,out:461] disconnected
l.a.c.f.m.MonitoringSessionStateListener : onLogout: session FIXT.1.1:SenderCompID/TargetCompID->MAIN[in:461,out:461] logged out

Expected behavior
I would expect the initiator to switch over to the failover acceptors when a socket connection failure happens. This is true when the IP address/hostname is not resolvable (the failover mechanism works as expected).

system information:

  • OS: Linux
  • Java 11
  • QFJ Version 2.3.0

Additional context
Is there a way to trigger the failover to the next acceptor programmatically?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions