Skip to content

Commit 7a14ed5

Browse files
committed
flag fix + linter
1 parent 5855b28 commit 7a14ed5

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

rust_snuba/src/strategies/blq_router.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ where
7070
fn is_enabled(consumer_group: &str) -> bool {
7171
options("snuba")
7272
.ok()
73-
.and_then(|o| o.get("consumer.blq_enabled").ok())
73+
.and_then(|o| o.get("consumer.blq_enabled_2").ok())
7474
.and_then(|v| v.as_str().map(str::to_owned))
75-
.map(|s| s != "" && s == consumer_group)
75+
.map(|s| !s.is_empty() && s == consumer_group)
7676
.unwrap_or(false)
7777
}
7878

@@ -116,7 +116,7 @@ where
116116
let new_flag = Self::is_enabled(&self.consumer_group);
117117
if !self.prev_flag_state && new_flag {
118118
tracing::info!(
119-
"consumer.blq_enabled flipped on at runtime; exiting consumer to flush downstream state"
119+
"consumer.blq_enabled_2 flipped on at runtime; exiting consumer to flush downstream state"
120120
);
121121
(self.exit_fn)();
122122
return Ok(None);
@@ -142,7 +142,7 @@ where
142142
let is_stale = elapsed > stale_threshold;
143143
if !is_stale {
144144
self.blq_active = false;
145-
return self.next_step.submit(message);
145+
self.next_step.submit(message)
146146
} else {
147147
self.producer.submit(message)
148148
}
@@ -254,7 +254,7 @@ mod tests {
254254

255255
set_override(
256256
"snuba",
257-
"consumer.blq_enabled",
257+
"consumer.blq_enabled_2",
258258
json!("test_consumer_group"),
259259
);
260260

@@ -271,7 +271,7 @@ mod tests {
271271
let _guard = override_options(&[
272272
(
273273
"snuba",
274-
"consumer.blq_enabled",
274+
"consumer.blq_enabled_2",
275275
json!("test_consumer_group"),
276276
),
277277
("snuba", "consumer.blq_stale_threshold_seconds", json!(10)),

sentry-options/schemas/snuba/schema.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,15 @@
1212
"default": false,
1313
"description": "true to emit a tracing log each time a duplicate trace item is detected in the accepted-outcomes aggregator"
1414
},
15-
"consumer.blq_enabled": {
15+
"consumer.blq_enabled_2": {
1616
"type": "string",
1717
"default": "",
18-
"description": "enable backlog queue in snuba consumers"
18+
"description": "enable backlog queue for the specified consumer group"
1919
},
2020
"consumer.blq_stale_threshold_seconds": {
2121
"type": "integer",
2222
"default": 1800,
2323
"description": "BLQ stale threshold in seconds. Messages older than this are routed to the backlog queue."
24-
},
25-
"consumer.blq_static_friction_seconds": {
26-
"type": "integer",
27-
"default": 120,
28-
"description": "BLQ hysteresis in seconds. Once routing stale, keep routing messages at least (stale_threshold - static_friction) old. Set to 0 to disable friction."
2924
}
3025
}
3126
}

0 commit comments

Comments
 (0)