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

Duplicate SessionID #614

Closed
fattymango opened this issue Jan 26, 2024 · 2 comments
Closed

Duplicate SessionID #614

fattymango opened this issue Jan 26, 2024 · 2 comments

Comments

@fattymango
Copy link

I'm creating a FIX(4.4) client and I'm trying to implement a retry mechanism that stops the entire initiator and starts it all over again, I'm doing this since the Quickfix auto reconnect doesn't send a ResetOnLogon in the reconnect message.

but when I try to create a new initiator with the same session I get a Duplicate SessionID error, I was able to reproduce the error and it appears to be from this function

func registerSession(s *session) error {
	sessionsLock.Lock()
	defer sessionsLock.Unlock()

	if _, ok := sessions[s.sessionID]; ok { // here
		return errDuplicateSessionID
	}

	sessions[s.sessionID] = s
	return nil
}

it works as expected when I remove the session check.

@AlexandrosKyriakakis
Copy link
Contributor

When you create a session (here) there is no way to remove it from this sessions map so when you create another initiator with same configs under the same thread you got the error Duplicate SessionID

We just need to remove the sessions map from global variables

@ackleymi
Copy link
Member

ackleymi commented May 9, 2024

Resolved with #637

@ackleymi ackleymi closed this as completed May 9, 2024
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

No branches or pull requests

3 participants