Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [0.20.8] - 2025-10-08

### Fixed
- Classified Redis `BusyLoadingError` responses as `DependencyUnavailable` and
preserved their retry advice in metadata so downstreams can distinguish cache
warmup from client mistakes when the `redis` feature is enabled.
- Serialized the serde_json syntax error position using the location reported
by `serde_json::Error` to stay aligned with the upstream parser changes.
- Guarded the tracing telemetry test with a process-wide mutex to prevent
spurious race failures when the full feature suite runs the test harness in
parallel.

## [0.20.7] - 2025-10-07

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion 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 Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "masterror"
version = "0.20.7"
version = "0.20.8"
rust-version = "1.90"
edition = "2024"
license = "MIT OR Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ The build script keeps the full feature snippet below in sync with

~~~toml
[dependencies]
masterror = { version = "0.20.7", default-features = false }
masterror = { version = "0.20.8", default-features = false }
# or with features:
# masterror = { version = "0.20.7", features = [
# masterror = { version = "0.20.8", features = [
# "axum", "actix", "openapi", "serde_json",
# "tracing", "metrics", "backtrace", "sqlx",
# "sqlx-migrate", "reqwest", "redis", "validator",
Expand Down
7 changes: 6 additions & 1 deletion src/app_error/tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[cfg(feature = "backtrace")]
#[cfg(any(feature = "backtrace", feature = "tracing"))]
use std::sync::Mutex;
use std::{borrow::Cow, error::Error as StdError, fmt::Display, sync::Arc};

Expand All @@ -8,6 +8,9 @@ use super::core::{reset_backtrace_preference, set_backtrace_preference_override}
#[cfg(feature = "backtrace")]
static BACKTRACE_ENV_GUARD: Mutex<()> = Mutex::new(());

#[cfg(feature = "tracing")]
static TELEMETRY_GUARD: Mutex<()> = Mutex::new(());

use super::{AppError, FieldRedaction, FieldValue, MessageEditPolicy, field};
use crate::{AppCode, AppErrorKind};

Expand Down Expand Up @@ -314,6 +317,8 @@ fn log_uses_kind_and_code() {
#[cfg(feature = "tracing")]
#[test]
fn telemetry_emits_single_tracing_event_with_trace_id() {
let _guard = TELEMETRY_GUARD.lock().expect("telemetry guard");

use std::{
fmt,
sync::{Arc, Mutex}
Expand Down
3 changes: 2 additions & 1 deletion src/convert/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
//! ```

#[cfg(feature = "redis")]
use redis::{RedisError, RetryMethod};
use redis::{ErrorKind, RedisError, RetryMethod};

#[cfg(feature = "redis")]
use crate::{AppErrorKind, Context, Error, field};
Expand Down Expand Up @@ -84,6 +84,7 @@ fn build_context(err: &RedisError) -> (Context, Option<u64>) {
|| err.is_connection_dropped()
|| err.is_cluster_error()
|| err.is_io_error()
|| matches!(err.kind(), ErrorKind::BusyLoadingError)
{
context = context.category(AppErrorKind::DependencyUnavailable);
}
Expand Down
2 changes: 1 addition & 1 deletion src/convert/serde_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ mod tests {
);
assert_eq!(
metadata.get("serde_json.position"),
Some(&FieldValue::Str("1:1".into()))
Some(&FieldValue::Str("1:2".into()))
);
}
}
Loading