quickfix-j / quickfixj

QuickFIX/J is a full featured messaging engine for the FIX protocol. - This is the official project repository.
http://www.quickfixj.org
Other
955 stars 611 forks source link

The bug of generateSequenceResetIfNeeded in resendMessages method #344

Open JavaNoviceForChina opened 3 years ago

JavaNoviceForChina commented 3 years ago

image

”generateSequenceResetIfNeeded“method:What I understand is that when the retrieved messages to be processed are less than the endseqno, for example, messages from 2 to 10 are expected to be sent, but only 2 to 6 are retrieved in persistence, and the sequence number needs to be reset to 11;However, there is a bug in the current code logic. When message 5 in 2 to 6 is an app message and 6 is an admin message, a reset message with sequence number 2 will be sent. However, the seqno expected by the other party has been reset to 6 when sending the app message with sequence number 5, which will cause the sequence number to be too low. I think the newbegin variable should be the sequence number expected by the current party, so it should be changed to Newbegin is defined above the for loop and is assigned the current sent message sequence number + 1 at appmessage justsent = true

chrjohn commented 3 years ago

Thanks for the report. Are you by any chance able to provide a unit test for this problem?

JavaNoviceForChina commented 3 years ago

I'm very sorry, this bug requires the client and server to conduct joint debugging test, so we can't write unit test

------------------ 原始邮件 ------------------ 发件人: "Christoph John"<notifications@github.com>; 发送时间: 2020年12月17日(星期四) 晚上6:26 收件人: "quickfix-j/quickfixj"<quickfixj@noreply.github.com>; 抄送: "淡忘"<614226243@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [quickfix-j/quickfixj] The bug of generateSequenceResetIfNeeded in resendMessages method (#344)

Thanks for the report. Are you by any chance able to provide a unit test for this problem?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

chrjohn commented 3 years ago

Could you please take a look at the tests in SessionTest and create a test based on that? It should be possible to reconstruct the problem with that. E.g. here is a test that also deals with resend request processing. You could use it as a template:

https://github.com/quickfix-j/quickfixj/blob/b12f2d3a7bc07ff8d146077f2356347c6104cf06/quickfixj-core/src/test/java/quickfix/SessionTest.java#L2127