Open philipwhiuk opened 1 year ago
I think best fix for this is to return
if send returns false, and not send the rest of the resend here:
https://github.com/quickfix-j/quickfixj/blob/dce91e62c7525b84448b974b796a1fac436015ae/quickfixj-core/src/main/java/quickfix/Session.java#L2378
But I'd welcome a second opinion.
Hi @philipwhiuk , thanks for opening the issue. I think it would be a very sensible enhancement.
AFAIK we do not act upon the return value of the send()
method anywhere since it is a leftover from the JNI compatibility and messages are sent async anyway (except if SocketSynchronousWrites
is false).
From the line of code that you quoted, we ultimately end up here when the responder
is not null
:
and from there to here:
This method might also return false
in two cases but I think it would be OK to abort the resend process in both cases since we can assume that the connection is either broken (and disconnected anyway) or the sync write timed out for one message and it would not make sense to resend the next message since at least one message was skipped over which subsequently would lead to another gap on the other side.
So in general it looks good to me. 👍
P.S.: Maybe we should open a follow-up issue to check if it is sensible to act upon the return value of send()
in other cases.
We should probably stop resending messages when the responder has disconnected.
The current behavior is to keep sending messages regardless, ignoring the return value of
send()
.Here's an anonymised log example.