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

sessionKey null check for command line #489

Merged

Conversation

devesh-b1
Copy link
Contributor

@devesh-b1 devesh-b1 commented Jul 19, 2023

Issue:
Framer.java - Line 158
sessionsEncoder.next() .....
.localCompId(sessionKey.localCompId()
NullPointerException - sessionKey is Null

Steps to reproduce:

  1. Start Artio server with sequence numbers IN(1) OUT(1)
  2. Start any test FIX client with sequence numbers IN(10) OUT(1)
  3. The sessions wont connect because sequence mismatch
  4. Client keeps connection attempts to server
  5. Start Artio command line (ArtioAdminTool)
  6. Fire command - printAllSessions
  7. Times out error because no output is received

Cause:
When a new client attempts to connect to Artio server, new instance of FixGatewaySession is created with sessionKey = null
The sessionKey is populated on Logon (FixGatewaySession.onLogon)
But in a scenario where there is sequence mismatch, the FixGatewaySession instance is created but onLogon callback is not invoked. Therefore sessionKey remains uninitialised

Solution:
Null check is added for sessionKey. The command printAllSessions works as expected after this change.

Many Thanks!

cc: @wojciech-adaptive

@devesh-b1
Copy link
Contributor Author

Hi @wojciech-adaptive

Can you please help have a look at this PR once you have time?
Thanks!!

@wojciech-adaptive wojciech-adaptive merged commit 8772c69 into real-logic:master Sep 7, 2023
pcdv pushed a commit to pcdv/artio that referenced this pull request Apr 5, 2024
* sessionKey null check for command line

* checkstyle adjusted
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

Successfully merging this pull request may close these issues.

None yet

2 participants