Skip to content

Commit

Permalink
fix(server): fix & remove unnecessary error logs on the server, updat…
Browse files Browse the repository at this point in the history
…e deps (#1563)

Remove unnecessary error logs on the server e.g. when trying to fetch
the resources by the client that might not exist, such as stream, topic
etc. Additionally, it improves all the existing error logs which missed
logging the received error. This commit also updates all the dependencies.
  • Loading branch information
spetz authored Feb 20, 2025
1 parent 9ceebbf commit e3f7282
Show file tree
Hide file tree
Showing 113 changed files with 1,186 additions and 1,007 deletions.
58 changes: 29 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ iggy = { path = "../sdk" }
iggy-bench-report = { path = "report" }
integration = { path = "../integration" }
nonzero_lit = "0.1.2"
serde = { version = "1.0.217", features = ["derive"] }
serde = { version = "1.0.218", features = ["derive"] }
sysinfo = "0.33.1"
tokio = { version = "1.43.0", features = ["full"] }
toml = "0.8.20"
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ login-session = ["dep:keyring"]

[dependencies]
ahash = { version = "0.8.11", features = ["serde"] }
anyhow = "1.0.95"
anyhow = "1.0.96"
clap = { version = "4.5.30", features = ["derive"] }
clap_complete = "4.5.45"
figlet-rs = "0.1.5"
Expand Down
6 changes: 3 additions & 3 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ path = "src/stream-builder/stream-producer-config/main.rs"

[dependencies]
ahash = { version = "0.8.11", features = ["serde"] }
anyhow = "1.0.95"
anyhow = "1.0.96"
bytes = "1.10.0"
clap = { version = "4.5.30", features = ["derive"] }
futures-util = "0.3.31"
iggy = { path = "../sdk" }
rand = "0.9.0"
serde = { version = "1.0.217", features = ["derive", "rc"] }
serde_json = "1.0.138"
serde = { version = "1.0.218", features = ["derive", "rc"] }
serde_json = "1.0.139"
tokio = { version = "1.43.0", features = ["full"] }
tracing = { version = "0.1.41" }
tracing-subscriber = { version = "0.3.19", features = ["fmt", "env-filter"] }
10 changes: 5 additions & 5 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ readme = "../README.md"
[dependencies]
aes-gcm = "0.10.3"
ahash = { version = "0.8.11", features = ["serde"] }
anyhow = "1.0.95"
anyhow = "1.0.96"
async-broadcast = { version = "0.7.2" }
async-dropper = { version = "0.3.1", features = ["tokio", "simple"] }
async-trait = "0.1.86"
Expand Down Expand Up @@ -51,8 +51,8 @@ reqwest = { version = "0.12.12", default-features = false, features = [
reqwest-middleware = { version = "0.4.0", features = ["json"] }
reqwest-retry = "0.7.0"
rustls = { version = "0.23.23", features = ["ring"] }
serde = { version = "1.0.217", features = ["derive", "rc"] }
serde_json = "1.0.138"
serde = { version = "1.0.218", features = ["derive", "rc"] }
serde_json = "1.0.139"
serde_with = { version = "3.12.0", features = ["base64"] }
strum = { version = "0.27.1", features = ["derive"] }
thiserror = "2.0.11"
Expand All @@ -66,8 +66,8 @@ webpki-roots = { version = "0.26.8" }

[build-dependencies]
convert_case = "0.7.1"
serde = { version = "1.0.217", features = ["derive", "rc"] }
serde_derive = "1.0.217"
serde = { version = "1.0.218", features = ["derive", "rc"] }
serde_derive = "1.0.218"

[features]
default = ["tokio_lock"]
Expand Down
10 changes: 5 additions & 5 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "server"
version = "0.4.209"
version = "0.4.210"
edition = "2021"
build = "src/build.rs"
license = "Apache-2.0"
Expand All @@ -13,7 +13,7 @@ mimalloc = ["dep:mimalloc"]

[dependencies]
ahash = { version = "0.8.11" }
anyhow = "1.0.95"
anyhow = "1.0.96"
async_zip = { version = "0.0.17", features = [
"tokio",
"lzma",
Expand Down Expand Up @@ -76,8 +76,8 @@ ring = "0.17.9"
rust-s3 = { version = "0.35.1", features = ["default"] }
rustls = { version = "0.23.23" }
rustls-pemfile = "2.2.0"
serde = { version = "1.0.217", features = ["derive", "rc"] }
serde_json = "1.0.138"
serde = { version = "1.0.218", features = ["derive", "rc"] }
serde_json = "1.0.139"
serde_with = { version = "3.12.0", features = ["base64", "macros"] }
static-toml = "1.3.0"
strum = { version = "0.27.1", features = ["derive"] }
Expand Down Expand Up @@ -106,7 +106,7 @@ mockall = "0.13.1"

[build-dependencies]
figment = { version = "0.10.19", features = ["json", "toml", "env"] }
serde_json = "1.0.138"
serde_json = "1.0.139"
vergen-git2 = { version = "1.0.5", features = [
"build",
"cargo",
Expand Down
12 changes: 6 additions & 6 deletions server/src/archiver/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ impl Archiver for DiskArchiver {
info!("Creating disk archiver directory: {}", self.config.path);
fs::create_dir_all(&self.config.path)
.await
.with_error_context(|err| {
.with_error_context(|error| {
format!(
"ARCHIVER - failed to create directory: {} with error: {err}",
"ARCHIVER - failed to create directory: {}. {error}",
self.config.path
)
})?;
Expand Down Expand Up @@ -66,11 +66,11 @@ impl Archiver for DiskArchiver {
let destination_path = destination.to_str().unwrap_or_default().to_owned();
fs::create_dir_all(destination.parent().unwrap())
.await
.with_error_context(|err| {
format!("{COMPONENT} - failed to create file: {file} at path: {destination_path} with error: {err}",)
.with_error_context(|error| {
format!("{COMPONENT} (error: {error}) - failed to create file: {file} at path: {destination_path}",)
})?;
fs::copy(source, destination).await.with_error_context(|err| {
format!("{COMPONENT} - failed to copy file: {file} to destination: {destination_path} with error: {err}")
fs::copy(source, destination).await.with_error_context(|error| {
format!("{COMPONENT} (error: {error}) - failed to copy file: {file} to destination: {destination_path}")
})?;
debug!("Archived file: {file} at: {destination_path}");
}
Expand Down
22 changes: 11 additions & 11 deletions server/src/archiver/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ impl S3Archiver {
debug!("Creating temporary S3 upload directory: {destination_path}");
fs::create_dir_all(destination.parent().unwrap())
.await
.with_error_context(|err| {
.with_error_context(|error| {
format!(
"{COMPONENT} - failed to create temporary S3 upload directory for path: {destination_path} with error: {err}"
"{COMPONENT} (error: {error}) - failed to create temporary S3 upload directory for path: {destination_path}"
)
})?;
debug!("Copying file: {path} to temporary S3 upload path: {destination_path}");
fs::copy(source, &destination).await.with_error_context(|err| {
format!("{COMPONENT} - failed to copy file: {path} to temporary S3 upload path: {destination_path} with error: {err}")
fs::copy(source, &destination).await.with_error_context(|error| {
format!("{COMPONENT} (error: {error}) - failed to copy file: {path} to temporary S3 upload path: {destination_path}")
})?;
debug!("File: {path} copied to temporary S3 upload path: {destination_path}");
Ok(destination_path)
Expand Down Expand Up @@ -138,7 +138,7 @@ impl Archiver for S3Archiver {
debug!("Archiving file: {source} on S3.");
let mut file = file::open(&source)
.await
.with_error_context(|err| format!("{COMPONENT} - failed to open source file: {source} for archiving with error: {err}"))?;
.with_error_context(|error| format!("{COMPONENT} (error: {error}) - failed to open source file: {source} for archiving"))?;
let base_directory = base_directory.as_deref().unwrap_or_default();
let destination = Path::new(&base_directory).join(path);
let destination_path = destination.to_str().unwrap_or_default().to_owned();
Expand All @@ -148,8 +148,8 @@ impl Archiver for S3Archiver {
.await;
if let Err(error) = response {
error!("Cannot archive file: {path} on S3: {}", error);
fs::remove_file(&source).await.with_error_context(|err| {
format!("{COMPONENT} - failed to remove temporary file: {source} after S3 failure with error: {err}")
fs::remove_file(&source).await.with_error_context(|error| {
format!("{COMPONENT} (error: {error}) - failed to remove temporary file: {source} after S3 failure")
})?;
return Err(ArchiverError::CannotArchiveFile {
file_path: path.to_string(),
Expand All @@ -160,15 +160,15 @@ impl Archiver for S3Archiver {
let status = response.status_code();
if status == 200 {
debug!("Archived file: {path} on S3.");
fs::remove_file(&source).await.with_error_context(|err| {
format!("{COMPONENT} - failed to remove temporary file: {source} after successful archive with error: {err}")
fs::remove_file(&source).await.with_error_context(|error| {
format!("{COMPONENT} (error: {error}) - failed to remove temporary file: {source} after successful archive")
})?;
continue;
}

error!("Cannot archive file: {path} on S3, received an invalid status code: {status}.");
fs::remove_file(&source).await.with_error_context(|err| {
format!("{COMPONENT} - failed to remove temporary file: {source} after invalid status code with error: {err}")
fs::remove_file(&source).await.with_error_context(|error| {
format!("{COMPONENT} (error: {error}) - failed to remove temporary file: {source} after invalid status code")
})?;
return Err(ArchiverError::CannotArchiveFile {
file_path: path.to_string(),
Expand Down
8 changes: 4 additions & 4 deletions server/src/binary/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ pub async fn handle(
sender
.send_error_response(error)
.await
.with_error_context(|_| {
format!("{COMPONENT} - failed to send error response, session: {session}")
.with_error_context(|error| {
format!("{COMPONENT} (error: {error}) - failed to send error response, session: {session}")
})?;
debug!("TCP error response was sent to: {session}.");
error!("Session: {session} will be deleted.");
Expand All @@ -53,8 +53,8 @@ pub async fn handle(
sender
.send_error_response(error)
.await
.with_error_context(|_| {
format!("{COMPONENT} - failed to send error response, session: {session}")
.with_error_context(|error| {
format!("{COMPONENT} (error: {error}) - failed to send error response, session: {session}")
})?;
debug!("TCP error response was sent to: {session}.");
Ok(())
Expand Down
Loading

0 comments on commit e3f7282

Please sign in to comment.