mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-06 13:27:43 +00:00
fix(audit): move audit init after IAM bootstrap to fix startup ordering (#5685)
Audit initialization requires the AppContext (server config + object store) which is published by ensure_startup_after_iam inside init_iam_runtime. Moving init_audit_runtime after init_iam_runtime ensures the runtime sources are available when audit starts. Fixes #5681 Co-authored-by: RustFS <hello@rustfs.com>
This commit is contained in:
@@ -75,11 +75,14 @@ pub(crate) async fn init_startup_runtime_services(
|
||||
let optional_runtimes = init_optional_runtime_services().await?;
|
||||
|
||||
init_buffer_profile_system(config);
|
||||
init_audit_runtime().await;
|
||||
init_deadlock_detector_runtime();
|
||||
|
||||
let buckets = init_bucket_metadata_runtime(store.clone(), ctx.clone()).await?;
|
||||
let iam_bootstrap = init_iam_runtime(store.clone(), ctx.clone(), readiness, state_manager, server_ctx).await?;
|
||||
|
||||
// Audit initialization requires the AppContext (server config + object store)
|
||||
// which is published by ensure_startup_after_iam inside init_iam_runtime.
|
||||
init_audit_runtime().await;
|
||||
// Unconditional: deferred IAM recovers in the background and has no callback into this
|
||||
// scheduler, so gating on the inline disposition would leave a recovered node with
|
||||
// self-pointing replication rules until the next restart. The task waits for IAM and
|
||||
|
||||
Reference in New Issue
Block a user