-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
only mark tokens as unsupported based on metrics for a limited time #3205
Changes from all commits
90fc80c
ba288d1
3345809
e732c6f
b3cadea
61b60e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -716,6 +716,15 @@ pub struct BadTokenDetectionConfig { | |
rename = "metrics-bad-token-detection-log-only" | ||
)] | ||
pub metrics_strategy_log_only: bool, | ||
|
||
/// How long the metrics based bad token detection should flag a token as | ||
/// unsupported before it allows to solve for that token again. | ||
#[serde( | ||
default = "default_metrics_bad_token_detector_freeze_time", | ||
rename = "metrics-bad-token-detection-token-freeze-time", | ||
with = "humantime_serde" | ||
)] | ||
pub metrics_strategy_token_freeze_time: Duration, | ||
} | ||
|
||
impl Default for BadTokenDetectionConfig { | ||
|
@@ -742,3 +751,7 @@ fn default_settle_queue_size() -> usize { | |
fn default_metrics_bad_token_detector_log_only() -> bool { | ||
true | ||
} | ||
|
||
fn default_metrics_bad_token_detector_freeze_time() -> Duration { | ||
Duration::from_secs(60 * 10) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIK, it doesn't exist. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah you're right, it is nightly api. |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this correct? if the
flagged_unsupported_at
is some and the time between freezing period and now is bigger than token freeze time, should it returnNone
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is explained in the comment. I think the confusion might come from the interface. I think all but 1 strategy (the hardcoded list) can only really return whether a token should be dropped but not if it needs to be kept.
The reason is that it's enough for a single metric to indicate that a token is bad but it's not enough if only 1 strategy says the token is good.
This could maybe be improved in a follow up PR adjusting these functions to return
Quality
instead ofOption<Quality>
and have the wrapping detector only pay attention toQuality::Unsupported
results in the short circuiting logic.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the upcoming PR you proposed would be really nice! thanks for the explanation!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually after thinking about this more
Option<Quality>
seems correct to me. That way we can express:I think I'll just adjust the comment and make it more explicit what gets returned. Because the current code focuses only on whether or not we have enough information to mark the token as unsupported.