private void nextResendRequest(Message resendRequest) throws IOException, RejectLogon, FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType, InvalidMessage { // QFJ-653: Check if seqnums are too low. // QFJ-673: Do not check if seqnums are too high in verify() since in case of a seqnum mismatch this will // enqueue the ResendRequest for later processing. This might lead to a deadlock situation in // which the counterparty waits for our messages to be resent and we are also waiting for our // ResendRequest to be satisfied in order to process the queued ResendRequest of the counterparty. // Instead, send out the requested messages and afterwards enqueue the ResendRequest in order to // later increase the target seqnum in method nextQueued(int). if (!verify(resendRequest, false, validateSequenceNumbers)) { return; } final int msgSeqNum = resendRequest.getHeader().getInt(MsgSeqNum.FIELD); if (validateSequenceNumbers && isTargetTooHigh(msgSeqNum)) { enqueueMessage(resendRequest, msgSeqNum); } final int beginSeqNo = resendRequest.getInt(BeginSeqNo.FIELD); final int endSeqNo = resendRequest.getInt(EndSeqNo.FIELD); getLog().onEvent( "Received ResendRequest FROM: " + beginSeqNo + " TO: " + formatEndSeqNum(endSeqNo)); manageGapFill(resendRequest, beginSeqNo, endSeqNo); }
private void nextResendRequest(Message resendRequest) throws IOException, RejectLogon, FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType, InvalidMessage { // QFJ-653: Check if seqnums are too low. // QFJ-673: Do not check if seqnums are too high in verify() since in case of a seqnum mismatch this will // enqueue the ResendRequest for later processing. This might lead to a deadlock situation in // which the counterparty waits for our messages to be resent and we are also waiting for our // ResendRequest to be satisfied in order to process the queued ResendRequest of the counterparty. // Instead, send out the requested messages and afterwards enqueue the ResendRequest in order to // later increase the target seqnum in method nextQueued(int). if (!verify(resendRequest, false, validateSequenceNumbers)) { return; } final int msgSeqNum = resendRequest.getHeader().getInt(MsgSeqNum.FIELD); if (validateSequenceNumbers && isTargetTooHigh(msgSeqNum)) { enqueueMessage(resendRequest, msgSeqNum); } final int beginSeqNo = resendRequest.getInt(BeginSeqNo.FIELD); final int endSeqNo = resendRequest.getInt(EndSeqNo.FIELD); getLog().onEvent( "Received ResendRequest FROM: " + beginSeqNo + " TO: " + formatEndSeqNum(endSeqNo)); manageGapFill(resendRequest, beginSeqNo, endSeqNo); }
private void nextResendRequest(Message resendRequest) throws IOException, RejectLogon, FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType, InvalidMessage { // QFJ-653: Check if seqnums are too low. // QFJ-673: Do not check if seqnums are too high in verify() since in case of a seqnum mismatch this will // enqueue the ResendRequest for later processing. This might lead to a deadlock situation in // which the counterparty waits for our messages to be resent and we are also waiting for our // ResendRequest to be satisfied in order to process the queued ResendRequest of the counterparty. // Instead, send out the requested messages and afterwards enqueue the ResendRequest in order to // later increase the target seqnum in method nextQueued(int). if (!verify(resendRequest, false, validateSequenceNumbers)) { return; } final int msgSeqNum = resendRequest.getHeader().getInt(MsgSeqNum.FIELD); if (validateSequenceNumbers && isTargetTooHigh(msgSeqNum)) { enqueueMessage(resendRequest, msgSeqNum); } final int beginSeqNo = resendRequest.getInt(BeginSeqNo.FIELD); final int endSeqNo = resendRequest.getInt(EndSeqNo.FIELD); getLog().onEvent( "Received ResendRequest FROM: " + beginSeqNo + " TO: " + formatEndSeqNum(endSeqNo)); manageGapFill(resendRequest, beginSeqNo, endSeqNo); }