Skip to content

Commit f3e11d6

Browse files
strangelydimvyazelenko
authored andcommitted
[Client/C] Fixed issue where conductor command drain loop might break out early when there was a padding record in the queue (#2045)
(cherry picked from commit c9d9b8b)
1 parent 531b9c9 commit f3e11d6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

aeron-client/src/main/c/aeron_client_conductor.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,10 +2746,10 @@ void aeron_client_conductor_on_close(aeron_client_conductor_t *conductor)
27462746
/* Free any remove_resource cmds still in the command queue. Every queued remove cmd is
27472747
* an inline message. The drain runs after resource teardown so on_complete fires after the resource is gone,
27482748
* matching the ordering in aeron_client_conductor_on_cmd_remove_resource. */
2749-
while (0 != aeron_mpsc_rb_read(
2750-
conductor->command_rb, aeron_client_conductor_drain_pending_cmd_on_close, conductor, SIZE_MAX))
2749+
while (0 < aeron_mpsc_rb_size(conductor->command_rb))
27512750
{
2752-
// loop.
2751+
aeron_mpsc_rb_read(
2752+
conductor->command_rb, aeron_client_conductor_drain_pending_cmd_on_close, conductor, SIZE_MAX);
27532753
}
27542754

27552755
aeron_int64_to_ptr_hash_map_for_each(

0 commit comments

Comments
 (0)