Skip to content

Conversation

@agshing
Copy link
Contributor

@agshing agshing commented Dec 5, 2025

Adds a simple getter, getFixedBacklogTimeoutMillis(), to LifoBlockingLimiter so the fixed backlog timeout configured via the builder can be inspected and serialized.

This does not change limiter behavior; it only exposes existing configuration for introspection and tooling.

*/
public Builder<ContextT> backlogTimeoutMillis(long timeout) {
this.maxBacklogTimeoutMillis = context -> timeout;
this.configuredBacklogTimeoutMillis = timeout;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a function is set through backlogTimeout, should we clear the configuredBacklogTimeoutMillis?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s a great suggestion. For cleanup purposes, we probably should. If we switch to a dynamic function, there’s no single fixed timeout anymore, so configuredBacklogTimeoutMillis could be cleared. I’m going to make configuredBacklogTimeoutMillis a boxed value so we can clear it by assigning null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

private final Limiter<ContextT> delegate;
private int maxBacklogSize = 100;
private Function<ContextT, Long> maxBacklogTimeoutMillis = context -> 1_000L;
private long configuredBacklogTimeoutMillis = 1_000L;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: is the goal to track the configured timeout or to quickly identify the value of any fixed timeout? If the latter, fixedBacklogTimeoutMillis would be a better name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal is to expose the value only when a fixed timeout is configured, not to track historical configuration. fixedBacklogTimeoutMillis is indeed a more accurate name. I’ll update the field and getter accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@agshing agshing force-pushed the add-backlog-timeout-getter branch from fff42fb to 5a198dc Compare December 5, 2025 18:36
@agshing agshing force-pushed the add-backlog-timeout-getter branch from 5a198dc to 09a3971 Compare December 5, 2025 19:12
@umairk79 umairk79 merged commit 39c74f7 into Netflix:main Dec 8, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants