{{Quickfixn}} QuickFIX\n logging error

Steve Walmsley Steve.Walmsley at ihsmarkit.com
Wed Jun 22 05:56:32 PDT 2022


Hi everyone,

We use QuickFIX\n in our application and one of our customers has been experiencing a regular error which crashes the application. We're unable to reproduce it. It happens on the customer side pretty much every time their FIX session reaches its EndTime.

This is the Stack Trace:

UnhandledExceptionHandler caught : System.IO.IOException: An unexpected network error occurred.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.FileStream.FlushInternalBuffer()
at System.IO.FileStream.Flush(Boolean flushToDisk)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
at QuickFix.FileLog.OnEvent(String s)
at QuickFix.Transport.SocketInitiator.SocketInitiatorThreadStart(Object socketInitiatorThread)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj): An unexpected network error occurred.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.FileStream.FlushInternalBuffer()
at System.IO.FileStream.Flush(Boolean flushToDisk)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
at QuickFix.FileLog.OnEvent(String s)
at QuickFix.Transport.SocketInitiator.SocketInitiatorThreadStart(Object socketInitiatorThread)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)

We have our own implementation of the QuickFIX ILogFactory interface but we just do that so that when the session expires we can safely copy the log file to another directory from where it can be archived. The customer with this bug doesn't use that functionality so in effect all our ILogFactor implementation does is to call the inbuilt QuickFIX logger. See the screenshot - I've stripped out some bits for simplicity but they're not actually used in the case of this customer.

[cid:image002.png at 01D88581.CAB059E0]

The obvious thing for us to do is to use Try-Catch blocks in all these methods but I was wondering if anyone has seen this before and has any thoughts about what could be causing this?

I think what the Stack Trace shows is that the QuickFix\n code first catches an error while trying to log event from SockInitiatorThreadStart, and then tries to log that error which throws an unhandled error that then crashes the application.

[cid:image003.png at 01D88582.881EC430]

I'm guessing maybe we should be doing something differently in disposing the logger when the session expires, but I don't understand why we can't reproduce the issue if that's the case.

I also thought that maybe the customer has some process in place that's interfering with log files at the time of session expiry but I can't find any evidence of that - plus we've tested with different end times and the same issue has occurred.

Any thoughts would be appreciated

Thanks

Steve Walmsley
He/Him
Developer

S&P Global Market Intelligence
Manchester
steve.walmsley at spglobal.com<mailto:steve.walmsley at spglobal.com>

[cid:image001.jpg at 01D8857F.AB1795A0]


________________________________

The information contained in this message is intended only for the recipient, and may be a confidential attorney-client communication or may otherwise be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, please be aware that any dissemination or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify us by replying to the message and deleting it from your computer. S&P Global Inc. reserves the right, subject to applicable local law, to monitor, review and process the content of any electronic message or information sent to or from S&P Global Inc. e-mail addresses without informing the sender or recipient of the message. By sending electronic message or information to S&P Global Inc. e-mail addresses you, as the sender, are consenting to S&P Global Inc. processing any of your personal data therein.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20220622/c7402f93/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 18892 bytes
Desc: image001.jpg
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20220622/c7402f93/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 130335 bytes
Desc: image002.png
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20220622/c7402f93/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 103390 bytes
Desc: image003.png
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20220622/c7402f93/attachment-0003.png>


More information about the Quickfixn mailing list