mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-01 17:58:22 +00:00
fix(logging): bound ECStore debug output (#6809)
Also replace deprecated Atomic::fetch_update calls with try_update so the current Rust toolchain keeps lint and CI jobs warning-clean. Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -69,6 +69,11 @@ checked_files=(
|
||||
"crates/targets/src/target/webhook.rs"
|
||||
"crates/ecstore/src/store/peer.rs"
|
||||
"crates/ecstore/src/store/init.rs"
|
||||
"crates/ecstore/src/store/mod.rs"
|
||||
"crates/ecstore/src/object_api/types.rs"
|
||||
"crates/ecstore/src/core/sets.rs"
|
||||
"crates/ecstore/src/set_disk/ops/object.rs"
|
||||
"crates/ecstore/src/bucket/replication/replication_pool.rs"
|
||||
"crates/s3-client/src/transition_api.rs"
|
||||
"crates/ecstore/src/services/tier/tier.rs"
|
||||
"crates/heal/src/heal/manager.rs"
|
||||
@@ -742,6 +747,27 @@ require_patterns "crates/obs/src/telemetry/rolling.rs" \
|
||||
'RollingAppender: Failed to rotate log file after' \
|
||||
'RollingAppender: failed to rotate log file'
|
||||
|
||||
for raw_ecstore_debug_field in \
|
||||
'.field("disk_map",' \
|
||||
'.field("pools",' \
|
||||
'.field("pool_meta",'; do
|
||||
if rg -n -F -- "$raw_ecstore_debug_field" crates/ecstore/src/store/mod.rs >/dev/null; then
|
||||
echo "❌ logging guardrail violation: ECStore Debug must stay bounded and must not render disk_map, pools, or pool_meta" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
for raw_object_options_debug_field in \
|
||||
'.field("tier_delete_journal_api", &self.tier_delete_journal_api)' \
|
||||
'.field("user_defined", &self.user_defined)' \
|
||||
'.field("eval_metadata", &self.eval_metadata)' \
|
||||
'.field("http_preconditions", &self.http_preconditions)'; do
|
||||
if rg -n -F -- "$raw_object_options_debug_field" crates/ecstore/src/object_api/types.rs >/dev/null; then
|
||||
echo "❌ logging guardrail violation: ObjectOptions Debug must summarize large or request-derived fields" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
if rg -n -F -- 'warn!(name = %MaskedAccessKey(name), user_type = ?user_type, "IAM user identity missing")' crates/iam/src/store/object.rs >/dev/null; then
|
||||
echo "❌ logging guardrail violation: missing IAM identity is an expected debug event, not a warning" >&2
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user