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: initiator doesn't reconnect when acceptor force closes connection at session endtime #873

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

Conversation

huwmjenkins
Copy link
Contributor

@huwmjenkins huwmjenkins commented Aug 5, 2024

If an initiator is logged on and the acceptor force closes the connection around session endtime then it looks like the initiator then can't reconnect as it gets in a never ending loop with an ObjectDisposedException around the cancellation token of the SocketInitiatorThread during the call to Disconnect

Failed to start: System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at QuickFix.SocketInitiatorThread.Disconnect()
at QuickFix.Session.Disconnect(String reason)
at QuickFix.Session.Reset(String loggedReason, String logoutMessage)
at QuickFix.AbstractInitiator.Connect()
at QuickFix.Transport.SocketInitiator.OnStart()

All this PR does is check if a disconnect has been requested already and if so don't bother with the rest of the disconnect method

@gbirchmeier
Copy link
Member

@huwmjenkins I pulled your branch, and I cannot get the test to pass locally. The final Assert.IsTrue fails.

If I increase the Monitor.Wait timeout to 12000, then the test passes but the process keeps running until my IDE pop up a warning to kill it.

Is this test really sensitive to timing? I'm running it on a Mac; maybe this platform is throwing the timing off.

What do you think? Any way we can make it more stable? (I haven't dug in too deep yet.)

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

Successfully merging this pull request may close these issues.

2 participants