Skip to content

Commit 7d7b7df

Browse files
committed
Fix #1: If a message is successfully sent but the sendq_move_to_sendmarkq(...) operation fails, it will be resent indefinitely
1 parent e71a827 commit 7d7b7df

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

lib/messager.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,15 +389,18 @@ static int _send_block (struct curvecpr_messager *messager, struct curvecpr_bloc
389389
messager->my_eof = 1;
390390

391391
messager->my_sent_bytes += block->data_len;
392-
393-
if (cf->ops.sendq_move_to_sendmarkq(messager, block, NULL)) {
394-
/* Some sort of warning? This message will get resent next time. */
395-
}
396392
} else {
397393
/* This is a retransmission, meaning we didn't receive an acknowledgment in
398394
quite some time. */
399395
curvecpr_chicago_on_timeout(&messager->chicago);
400396
}
397+
398+
if (cf->ops.sendq_move_to_sendmarkq(messager, block, NULL)) {
399+
/* This could fail if the message has already been sent (i.e., it was already
400+
moved to the to-be-marked queue), but we must call it any time block is
401+
sent because it could fail for any other arbitrary reason as well and need
402+
to be reinvoked. */
403+
}
401404
}
402405

403406
/* Remove all the acknowledged ranges from the pending queue. */

0 commit comments

Comments
 (0)