[QFJ-338] Response to TestRequest received before the SessionState is updated Created: 19/Aug/08 Updated: 06/Oct/08 Resolved: 10/Sep/08 |
|
| Status: | Closed |
| Project: | QuickFIX/J |
| Component/s: | Engine |
| Affects Version/s: | 1.3.1 |
| Fix Version/s: | 1.3.3 |
| Type: | Bug | Priority: | Default |
| Reporter: | aleksey ratushnyy | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The problem: When a response to TestRequest is received too quickly, a false positive heartbeat timeout happens and causes disconnection. In method quickfix.Session.next() there exists the following code: if (state.isTestRequestNeeded()) { generateTestRequest("TEST"); state.incrementTestRequestCounter(); getLog().onEvent("Sent test request TEST"); stateListener.onMissedHeartBeat(); }else if (state.isHeartBeatNeeded()) { generateHeartbeat(); }In this code, Whenever this condition happens, there is always a false disconnect due to missed heartbeats (assuming the server does not send unsolicited heartbeats) (why this happens:
Note: it is not a theoretical issue, the problem does occur time to time |
| Comments |
| Comment by Steve Bate [ 10/Sep/08 ] |
|
Based on my analysis, it appears it would fix the problem if I reversed the increment of the test counter and the sending of the message. Do you agree with that? |
| Comment by aleksey ratushnyy [ 10/Sep/08 ] |
|
As long as you are sure it is not going to introduce any other strange race condition |