[QFJ-701] Restart FIX engine occur I/O exception Created: 04/Sep/12  Updated: 04/Sep/12  Resolved: 04/Sep/12

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.4.0
Fix Version/s: None

Type: Other Priority: Default
Reporter: Li,Wei Assignee: Unassigned
Resolution: Not a bug Votes: 0
Labels: logon
Environment:

Windows 2003 Server


Issue Links:
Relates
is related to QFJ-653 IOException if sessionTimestamp file ... Closed

 Description   

Recently when our system was restarted, occasionally occur I/O exception, the following:

quickfix.ConfigError: error during session initialization
at quickfix.mina.initiator.AbstractSocketInitiator.createSessions(AbstractSocketInitiator.java:135)
at quickfix.mina.initiator.AbstractSocketInitiator.createSessionInitiators(AbstractSocketInitiator.java:84)
at quickfix.SocketInitiator.initialize(SocketInitiator.java:84)
at quickfix.SocketInitiator.start(SocketInitiator.java:64)
at com.rootnet.fix.framework.FixModule.startup(FixModule.java:142)
at com.rootnet.fix.algo.FixAlgoGateway.main(FixAlgoGateway.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:238)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.RuntimeException: java.io.IOException
at quickfix.FileStoreFactory.create(FileStoreFactory.java:80)
at quickfix.Session.<init>(Session.java:338)
at quickfix.DefaultSessionFactory.create(DefaultSessionFactory.java:156)
at quickfix.mina.SessionConnector.createSession(SessionConnector.java:114)
at quickfix.mina.initiator.AbstractSocketInitiator.createSessions(AbstractSocketInitiator.java:129)
... 11 more
Caused by: java.io.IOException
at quickfix.FileStore.initializeSessionCreateTime(FileStore.java:133)
at quickfix.FileStore.initializeCache(FileStore.java:120)
at quickfix.FileStore.initialize(FileStore.java:113)
at quickfix.FileStore.<init>(FileStore.java:100)
at quickfix.FileStoreFactory.create(FileStoreFactory.java:78)
... 15 more

I check .session file in store directory, find that it is an empty file. And as long as this file is empty, start FIX engine must occur this I/O exception.

I compare quickfixj1.4.0 and quickfixj1.5.2, find the code was strengthened, increased 'sessionTimeFile.length() > 0', by this way when .session file is an empty file, will execute storeSessionTimeStamp(), program will be correctly executed. This handle whether it is in order to avoid .session empty file lead to I/O exception. So what science would generate a empty .session file?

--quickfixj1.5.2
private void initializeSessionCreateTime() throws IOException {
final File sessionTimeFile = new File(sessionFileName);
if (sessionTimeFile.exists() && sessionTimeFile.length() > 0) {
final DataInputStream sessionTimeInput = new DataInputStream(new BufferedInputStream(
new FileInputStream(sessionTimeFile)));
try

{ final Calendar c = SystemTime.getUtcCalendar(UtcTimestampConverter .convert(sessionTimeInput.readUTF())); cache.setCreationTime(c); }

catch (final Exception e)

{ throw new IOException(e.getMessage()); }

finally

{ sessionTimeInput.close(); }

} else

{ storeSessionTimeStamp(); }

}



 Comments   
Comment by Christoph John [ 04/Sep/12 ]

I don't really understand the intention of this issue.

Is it just the question under which circumstances an empty session file would be generated? I don't know exactly but we also faced this issue when one of our process crashed on startup. I guess this is due to the method FileStore.storeSessionTimeStamp() which creates the file and closes it (regardless of whether a timestamp could be stored or not).

Comment by Christoph John [ 04/Sep/12 ]

If you still have questions, please ask on the mailing list: http://quickfixj.org/support/

Thank you.

Generated at Sat Nov 23 11:24:12 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.