Skip to content

Commit 43403ea

Browse files
committed
formatting fix
Signed-off-by: Patrick Riel <[email protected]>
1 parent 8cd3e7d commit 43403ea

File tree

1 file changed

+62
-19
lines changed
  • lib/llm/src/block_manager/v2/physical/transfer/nixl_agent

1 file changed

+62
-19
lines changed

lib/llm/src/block_manager/v2/physical/transfer/nixl_agent/mod.rs

Lines changed: 62 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,28 @@ impl NixlAgent {
6161
params.add(&param_key, &env_value)?;
6262

6363
// Redact sensitive-looking parameters
64-
let display_value = if param_key.contains("secret") || param_key.contains("key") && param_key != "access_key" {
64+
let display_value = if param_key.contains("secret")
65+
|| param_key.contains("key") && param_key != "access_key"
66+
{
6567
"<REDACTED>".to_string()
6668
} else {
6769
env_value.clone()
6870
};
69-
param_sources.push(format!("{}={} (from {})", param_key, display_value, env_key));
71+
param_sources.push(format!(
72+
"{}={} (from {})",
73+
param_key, display_value, env_key
74+
));
7075
found_any = true;
7176
}
7277
}
7378
if !found_any {
7479
return Ok(None);
7580
}
7681

77-
tracing::debug!("{} backend parameters configured from environment:", backend_name);
82+
tracing::debug!(
83+
"{} backend parameters configured from environment:",
84+
backend_name
85+
);
7886
for source in &param_sources {
7987
tracing::debug!(" {}", source);
8088
}
@@ -126,15 +134,19 @@ impl NixlAgent {
126134
Err(e) => {
127135
tracing::error!(
128136
"Failed to create {} backend with provided params: {}. Operations requiring this backend will fail.",
129-
backend_upper, e
137+
backend_upper,
138+
e
130139
);
131140
}
132141
}
133142
}
134143

135144
if available_backends.is_empty() {
136145
let backend_names: Vec<_> = backends.iter().map(|(name, _)| *name).collect();
137-
anyhow::bail!("Failed to initialize any NIXL backends from {:?}", backend_names);
146+
anyhow::bail!(
147+
"Failed to initialize any NIXL backends from {:?}",
148+
backend_names
149+
);
138150
}
139151

140152
Ok(Self {
@@ -178,12 +190,17 @@ impl NixlAgent {
178190
match agent.create_backend(&backend_upper, &custom_params) {
179191
Ok(_) => {
180192
available_backends.insert(backend_upper.clone());
181-
tracing::debug!("{} backend created with custom configuration from environment", backend_upper);
193+
tracing::debug!(
194+
"{} backend created with custom configuration from environment",
195+
backend_upper
196+
);
182197
}
183198
Err(e) => {
184199
tracing::error!(
185200
"Failed to create {} backend with custom params: {}. Check your DYN_KVBM_NIXL_BACKEND_{}_* environment variables.",
186-
backend_upper, e, backend_upper
201+
backend_upper,
202+
e,
203+
backend_upper
187204
);
188205
}
189206
}
@@ -198,7 +215,8 @@ impl NixlAgent {
198215
Err(e) => {
199216
tracing::error!(
200217
"Failed to create {} backend: {}. Operations requiring this backend will fail.",
201-
backend_upper, e
218+
backend_upper,
219+
e
202220
);
203221
}
204222
},
@@ -271,9 +289,15 @@ impl NixlAgent {
271289
tracing::debug!("{} backend created with provided parameters", backend_upper);
272290
}
273291
Err(e) => {
274-
tracing::error!("Failed to create {} backend with provided params: {}", backend_upper, e);
275-
failed_backends
276-
.push((backend_upper.clone(), format!("create with provided params failed: {}", e)));
292+
tracing::error!(
293+
"Failed to create {} backend with provided params: {}",
294+
backend_upper,
295+
e
296+
);
297+
failed_backends.push((
298+
backend_upper.clone(),
299+
format!("create with provided params failed: {}", e),
300+
));
277301
}
278302
}
279303
}
@@ -337,12 +361,21 @@ impl NixlAgent {
337361
match agent.create_backend(&backend_upper, &custom_params) {
338362
Ok(_) => {
339363
available_backends.insert(backend_upper.clone());
340-
tracing::debug!("{} backend created with custom configuration from environment", backend_upper);
364+
tracing::debug!(
365+
"{} backend created with custom configuration from environment",
366+
backend_upper
367+
);
341368
}
342369
Err(e) => {
343-
tracing::error!("✗ Failed to create {} backend with custom params: {}", backend_upper, e);
344-
failed_backends
345-
.push((backend_upper.clone(), format!("create with custom params failed: {}", e)));
370+
tracing::error!(
371+
"✗ Failed to create {} backend with custom params: {}",
372+
backend_upper,
373+
e
374+
);
375+
failed_backends.push((
376+
backend_upper.clone(),
377+
format!("create with custom params failed: {}", e),
378+
));
346379
}
347380
}
348381
}
@@ -354,7 +387,11 @@ impl NixlAgent {
354387
available_backends.insert(backend_upper);
355388
}
356389
Err(e) => {
357-
tracing::error!("✗ Failed to create {} backend: {}", backend_upper, e);
390+
tracing::error!(
391+
"✗ Failed to create {} backend: {}",
392+
backend_upper,
393+
e
394+
);
358395
failed_backends
359396
.push((backend_upper.clone(), format!("create failed: {}", e)));
360397
}
@@ -367,9 +404,15 @@ impl NixlAgent {
367404
}
368405
}
369406
Err(e) => {
370-
tracing::error!("Failed to parse {} backend parameters from environment: {}", backend_upper, e);
371-
failed_backends
372-
.push((backend_upper.clone(), format!("params parsing failed: {}", e)));
407+
tracing::error!(
408+
"Failed to parse {} backend parameters from environment: {}",
409+
backend_upper,
410+
e
411+
);
412+
failed_backends.push((
413+
backend_upper.clone(),
414+
format!("params parsing failed: {}", e),
415+
));
373416
}
374417
}
375418
}

0 commit comments

Comments
 (0)