Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-133

Return of bug 89 - session lookup causes an NPE if JdbcLog is miconfigured initially

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Default
    • Resolution: Fixed
    • Affects Version/s: 1.0.5
    • Fix Version/s: 1.1.0
    • Component/s: Engine
    • Labels:
      None

      Description

      I'm able to reproduce the same situation as was in bug 89 initially (http://www.quickfixj.org/jira/browse/QFJ-89)

      If you misconfigure the JdbcLog (wrong db name, or just turn off the db altogether), you get into a situation where JdbcLog calls into LogUtil.logThrowable() which tries to lookup the session through Session.lookupSession() which comes back as null and that produces an NPE.

      There are actually 2 bugs:
      1. When you create a session you try to log session creation.
      2. if jdbc log is misconfigured, we get an exception and go into LogUtil.logThrowable() which calls through to Session.lookupSession()
      3. since we haven't registered the session yet we get an NPE in LogUtil.logThrowable()

      Second bug (this has to do with proxool)
      1. When we get the NPE in the above scenario, we try to log it again, which essentially ends up doing this recursively and we run out of memory (see the attached stack trace).

      I will create an issue to track the 2nd bug separately as well.

      I am submitting a patch that's fixing both bugs:
      1. Move the session registration code back from DefaultSessionFactory.create() to the Session() constructor
      2. Modify the behaviour of the JdbcLog.insert() to keep track if we are being called recursively and ignore the recursive request in that case. Probably would be a good time to log somewhere else in that case though.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                admin Steve Bate
                Reporter:
                toli Toli Kuznets
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: