On reconnect, resend request is missing the first sequence number of the batch missed

Description

During certification testing with Interactive Brokers, they've noticed a very concerning bug wherein upon reconnect the client is requesting a resend for all but the first message missed during the missed connection.

We're using a ReliableClientSession and in our configuration we have ignore_login_sequence_check as true. If we don't set that flag as true then an exception is thrown as soon as there's a sequence number mismatch on login upon reconnect. Doesn't matter if they disconnected or we did.

See below for the relevant logs:

You'll notice that the received sequence number is 11 and our last sequence number is 6. So ideally we should be requesting sequence 8 onwards (because the resend request itself is sequence number 7) but instead 9 onwards is being requested. We're thus missing an execution from our broker.

0000001 out 8=FIX.4.2^A9=61^A35=A^A49=direc599^A56=IB^A34=6^A52=20160621-14:39:52^A98=0^A108=30^A10=117^A

0000001 in 8=FIX.4.2^A9=000071^A35=A^A34=000011^A43=N^A52=20160621-14:39:52^A49=IB^A56=direc599^A98=0^A108=30^A10=021^A

0000002 in 8=FIX.4.2^A9=000059^A35=0^A34=000012^A43=N^A52=20160621-14:40:22^A49=IB^A56=direc599^A10=231^A

0000002 out 8=FIX.4.2^A9=58^A35=2^A49=direc599^A56=IB^A34=7^A52=20160621-14:40:22^A7=9^A16=0^A10=204^A

0000003 in 8=FIX.4.2^A9=000285^A35=8^A34=000009^A43=Y^A122=20160621-14:39:36^A52=20160621-14:40:22^A49=IB^A56=direc599^A11=135^A17=00002b45.ad2e$

0000004 in 8=FIX.4.2^A9=000285^A35=8^A34=000010^A43=Y^A122=20160621-14:39:40^A52=20160621-14:40:22^A49=IB^A56=direc599^A11=135^A17=00002b45.ad2e$

0000005 in 8=FIX.4.2^A9=000071^A35=4^A34=000011^A43=Y^A52=20160621-14:40:22^A49=IB^A56=direc599^A123=Y^A36=13^A10=039^A

0000006 in 8=FIX.4.2^A9=000059^A35=0^A34=000013^A43=N^A52=20160621-14:40:52^A49=IB^A56=direc599^A10=235^A

0000003 out 8=FIX.4.2^A9=49^A35=0^A49=direc599^A56=IB^A34=8^A52=20160621-14:40:52^A10=075^A

Environment

Red Hat Enterprise Linux 7
GCC 4.8.5

Assignee

David Dight

Reporter

Alfredo Luque

Labels

None

Branch

master

Products

Open Source

Components

Fix versions

Affects versions

Priority

Critical
Configure