Skip to content

Commit

Permalink
Merge pull request #168 from AestheticIntegration/kostya/gapfill-yes-…
Browse files Browse the repository at this point in the history
…reset

Adding GapFill=Y special treatment when in the Recovery mode
  • Loading branch information
ewenmaclean authored Feb 10, 2022
2 parents 0cf883c + a18f30e commit 4c5062c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
17 changes: 17 additions & 0 deletions defs/Imandra7_CriticalResetLogon.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
iCONNECT
I8=FIX.4.435=A34=10749=TW52=<TIME>56=ISLD98=0108=30
E8=FIX.4.435=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=3010=0

# ResendRequest - reply with GapFill=N
E8=FIX.4.435=234=249=ISLD56=TW52=00000000-00:00:00.0007=116=010=0
I8=FIX.4.435=434=10849=TW56=ISLD43=Y52=<TIME>122=<TIME>36=109123=N

# Checking that SeqNums are properly reset
I8=FIX.4.435=134=10949=TW52=<TIME>56=ISLD112=HELLO
E8=FIX.4.435=034=349=ISLD52=00000000-00:00:00.00056=TW112=HELLO10=0

# logout message and response
I8=FIX.4.435=534=11049=TW52=<TIME>56=ISLD
E8=FIX.4.435=534=449=ISLD52=00000000-00:00:00.00056=TW10=0

eDISCONNECT
1 change: 1 addition & 0 deletions run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ run_test ./defs/Imandra3_CacheReplayApplication.def
run_test ./defs/Imandra4_CacheReplayOutOfOrder.def
run_test ./defs/Imandra5_SeqResetWithGapFillOvershoot.def
run_test ./defs/Imandra6_CacheReplayAdminOnly.def
run_test ./defs/Imandra7_CriticalResetLogon.def

rm dune
10 changes: 8 additions & 2 deletions src/fix_engine_transitions.iml
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,15 @@ let run_recovery ( m, engine : full_valid_fix_msg * fix_engine_state ) =
| _ ->
let msg = match m with
| { full_msg_header = { h_msg_seq_num; _ }
; full_msg_data = Full_FIX_Admin_Msg (Full_Msg_Sequence_Reset { seqr_new_seq_no; _ } )
; full_msg_data = Full_FIX_Admin_Msg (Full_Msg_Sequence_Reset { seqr_new_seq_no; seqr_gap_fill_flag } )
; _ } ->
CacheGap (h_msg_seq_num, seqr_new_seq_no)
(* If the GapFillFlag <123> field is not present (or set to N).
The MsgSeqNum <34> in the header should be ignored... *)
let gap_start = match seqr_gap_fill_flag with
| Some FIX_GapFillFlag_Y -> h_msg_seq_num
| _ -> engine.incoming_seq_num
in
CacheGap (gap_start, seqr_new_seq_no)
| _ -> CacheMessage(m)
in
let new_cache = update_cache engine.fe_cache msg in
Expand Down

0 comments on commit 4c5062c

Please sign in to comment.