You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are attempting to dynamically Add/Remove sessions to/from the ThreadedSocketAcceptor so that any Initiator applications can Connect/Disconnect respectively. When Adding a session that was previously removed, an exception is thrown; "System.IO.IOException: The process cannot access the file 'C:\store\FIX.4.4-Sender-Target.header' because it is being used by another process.". Note that the above does not always occur and it seems that there is some kind of race condition. In addition, the exception can also refer to the .seqnums file as well.
2. A simplistic example of steps for reproducing the problem
When AddSession(SessionID) is called, the FileStoreFactory creates a FileStore which then calls its private method ConstructFromFileCache(). While attempting to open the headerFileName_ it throws the aforementioned exception.
To me, the exception throw is very strange because RemoveSession(sessionID, true) was called prior calling AddSession(sessionID). RemoveSession disposes the Session which in turn disposes the FileStore which in turn disposes its headerFile_.
Can you please advise whether the above problem is already known?
Should we take any additional step in-between the acceptor.RemoveSession and acceptor.AddSession to guarantee that such an exception is not thrown?
Kind regards
The text was updated successfully, but these errors were encountered:
1. Overview
We are attempting to dynamically Add/Remove sessions to/from the ThreadedSocketAcceptor so that any Initiator applications can Connect/Disconnect respectively. When Adding a session that was previously removed, an exception is thrown; "System.IO.IOException: The process cannot access the file 'C:\store\FIX.4.4-Sender-Target.header' because it is being used by another process.". Note that the above does not always occur and it seems that there is some kind of race condition. In addition, the exception can also refer to the .seqnums file as well.
2. A simplistic example of steps for reproducing the problem
SessionID sessionID = new SessionID(Values.BeginString_FIX44, "SenderID", "TargetID");
ThreadedSocketAcceptor acceptor = new ThreadedSocketAcceptor(...);
acceptor.AddSession(sessionID);
acceptor.Start();
while(true) {
acceptor.RemoveSession(sessionID, true);
acceptor.AddSession(sessionID); // throws Exception
}
3. Delving into the details
When AddSession(SessionID) is called, the FileStoreFactory creates a FileStore which then calls its private method ConstructFromFileCache(). While attempting to open the headerFileName_ it throws the aforementioned exception.
To me, the exception throw is very strange because RemoveSession(sessionID, true) was called prior calling AddSession(sessionID). RemoveSession disposes the Session which in turn disposes the FileStore which in turn disposes its headerFile_.
Can you please advise whether the above problem is already known?
Should we take any additional step in-between the acceptor.RemoveSession and acceptor.AddSession to guarantee that such an exception is not thrown?
Kind regards
The text was updated successfully, but these errors were encountered: