Description
The implementation of up(MessageBatch) in FRAG and FRAG2 is incorrect because messages reassmbled from fragments are re-inserted into the batch at the end rather than in the place of the fragments.
Example: when we receive P1 P2 P3:1 P3:2 P3:3 and P4 (P3 was split into 3 fragments by sender P), then the resulting batch (see the code below) will be P1 P2 P4 P3, as the re-assembled message P3 is added to the end of the batch rather than re-inserted in-place.
public void up(MessageBatch batch) { for(Message msg: batch) { FragHeader hdr=(FragHeader)msg.getHeader(this.id); if(hdr != null) { // needs to be defragmented batch.remove(msg); Message assembled_msg=unfragment(msg,hdr); if(assembled_msg != null) batch.add(assembled_msg); // the newly added message will not get iterated over by the current iterator ! } } if(!batch.isEmpty()) up_prot.up(batch); }
Attachments
Issue Links
- is duplicated by
-
JGRP-1644 NAKACK2 violates FIFO property
- Closed