Search code examples
aeron

Why do aeron publication image positions take part in flow control during the linger state?


When a untethered subscription falls behind, after untethered window limit timeout in the bottom 1/4 of the receive window it will transition to the linger state, it will then spend another period of time (untethered window limit timeout again) before transitioning to the resting state. During this time it still takes part in local flow control.

What is the benefit of this lagging subscription from continuing to take part in local flow control?

I'd expect it makes sense to immediately move the subscription into the resting state, as it doesn't seem like it can recover from the linger state in any other way.


Solution

  • There is a delay between a subscription falling outside the window and the unavailable image notification reaching the client and then being acted on. The linger prevents the image being aggressively progressed which has the potential for corrupting of the log buffer data structure. It is a similar protection to why the image in the driver has a linger state.