Skip to content

Commit f6f76cf

Browse files
committed
fix: base_path_without_preciding_slah function
1 parent a2d3cd4 commit f6f76cf

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

server/src/handlers/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub(crate) fn cross_origin_config() -> Cors {
5757
}
5858

5959
pub fn base_path_without_preceding_slash() -> String {
60-
format!("/{API_BASE_PATH}/{API_VERSION}")
60+
format!("{API_BASE_PATH}/{API_VERSION}")
6161
}
6262

6363
pub async fn fetch_schema(stream_name: &str) -> anyhow::Result<arrow_schema::Schema> {

server/src/handlers/http/modal/query_server.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ impl QueryServer {
309309
stream_name
310310
);
311311

312+
// roll back the stream creation
312313
Self::send_stream_rollback_request(&url, ingester.clone()).await?;
313314
}
314315

@@ -322,6 +323,7 @@ impl QueryServer {
322323
Ok(())
323324
}
324325

326+
/// get the cumulative stats from all ingesters
325327
pub async fn fetch_stats_from_ingesters(
326328
stream_name: &str,
327329
) -> Result<QueriedStats, StreamError> {
@@ -376,6 +378,7 @@ impl QueryServer {
376378
Ok(stats)
377379
}
378380

381+
/// send a request to the ingester to fetch its stats
379382
async fn send_stats_request(
380383
url: &str,
381384
ingester: IngesterMetadata,
@@ -473,6 +476,7 @@ impl QueryServer {
473476
Ok(())
474477
}
475478

479+
/// send a rollback request to all ingesters
476480
async fn send_stream_rollback_request(
477481
url: &str,
478482
ingester: IngesterMetadata,
@@ -489,6 +493,7 @@ impl QueryServer {
489493
.send()
490494
.await
491495
.map_err(|err| {
496+
// log the error and return a custom error
492497
log::error!(
493498
"Fatal: failed to rollback stream creation: {}\n Error: {:?}",
494499
ingester.domain_name,
@@ -503,6 +508,8 @@ impl QueryServer {
503508
}
504509
})?;
505510

511+
// if the response is not successful, log the error and return a custom error
512+
// this could be a bit too much, but we need to be sure it covers all cases
506513
if !resp.status().is_success() {
507514
log::error!(
508515
"failed to rollback stream creation: {}\nResponse Returned: {:?}",

0 commit comments

Comments
 (0)