A cluster rehearsal moved a Log tracer to another directory: the write was reported x:settingsReload applied:true, but the tracer kept writing to the old file until a restart. Telemetry::update only refreshed each running tracer's events, level and lossiness; a tracer's own settings (path, prefix, rotation, format, endpoint, headers, ...) stayed as built. Each tracer now carries a hash of the registry object it was built from, less the fields that change in place. The reload compares it with the running tracer's: unchanged ones are updated in place as before, changed ones are started over, new ones started and removed ones stopped. Only tracers this server started are removed; upstream removed every subscriber not in the settings, which also cut off live-tracing streams on each reload. Starting over is a swap in the collector, so no event is lost or written twice: a subscriber registered under a running one's id replaces it between two collection passes. The old one's batch is sent first (what its full channel can't take moves to the new one), and dropping it closes its channel, so its task writes what is queued and ends. Per tracer kind: - Log: a tracer started over on the same files (rotation or format changed) waits for the old one to finish, so lines don't interleave. - Webhook: the task held a sender of its own channel for retries, so it never ended; retries now use a weak sender, and pending events are posted when the channel closes. - OpenTelemetry: pending logs and spans are exported when the channel closes instead of dropped, and a span that was open across the swap is exported by the new tracer with the events it saw. - Console and journal: nothing kept between batches. - Trace history: built from the tracing store, which takes a restart, so it is never started over. No kind needs a restart, so x:settingsReload doesn't gain one. system::tracer_reload::tracer_reload_tests (new): a Log tracer created over JMAP writes to its directory; its path is changed over JMAP while 2000 numbered events are emitted; after the reload, events land in the new file and not the old one, each numbered event is in exactly one of the two files, and a destroyed tracer writes nothing. On main the new file never appears.
90 lines
2.3 KiB
Rust
90 lines
2.3 KiB
Rust
/*
|
|
* SPDX-FileCopyrightText: 2020 Stalwart Labs LLC <[email protected]>
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
|
*
|
|
* Modified by Coffey Labs in 2026 for INBUXA.
|
|
*/
|
|
|
|
pub mod antispam;
|
|
pub mod authentication;
|
|
pub mod ai;
|
|
pub mod ai_calibration;
|
|
pub mod authorization;
|
|
pub mod auto_reload; // inbuxa: registry writes apply at once
|
|
pub mod branding;
|
|
pub mod crypto;
|
|
pub mod delivery;
|
|
pub mod directory;
|
|
pub mod masked_email;
|
|
pub mod monitoring;
|
|
pub mod oidc;
|
|
pub mod purge;
|
|
pub mod quota;
|
|
pub mod reload; // inbuxa: reloads and build errors
|
|
pub mod security;
|
|
pub mod task;
|
|
pub mod tracer_reload; // inbuxa: tracers start over when their settings change
|
|
pub mod tenant;
|
|
pub mod undelete;
|
|
|
|
use crate::utils::server::TestServerBuilder;
|
|
use registry::schema::structs::{Expression, Imap, MtaStageAuth};
|
|
|
|
#[tokio::test(flavor = "multi_thread")]
|
|
pub async fn system_tests() {
|
|
let mut test = TestServerBuilder::new("system_tests")
|
|
.await
|
|
.with_default_listeners()
|
|
.await
|
|
.with_object(Imap {
|
|
allow_plain_text_auth: true,
|
|
..Default::default()
|
|
})
|
|
.await
|
|
.with_object(MtaStageAuth {
|
|
require: Expression {
|
|
else_: "false".to_string(),
|
|
..Default::default()
|
|
},
|
|
..Default::default()
|
|
})
|
|
.await
|
|
.build()
|
|
.await;
|
|
|
|
// Create admin account
|
|
let admin = test
|
|
.create_user_account(
|
|
"admin",
|
|
"[email protected]",
|
|
"these_pretzels_are_making_me_thirsty",
|
|
&[],
|
|
"Admin",
|
|
)
|
|
.await;
|
|
test.account("admin")
|
|
.assign_roles_to_account(admin.id(), &["user", "system"])
|
|
.await;
|
|
test.insert_account(admin);
|
|
|
|
directory::test(&test).await;
|
|
authentication::test(&test).await;
|
|
oidc::test(&mut test).await;
|
|
authorization::test(&mut test).await;
|
|
tenant::test(&mut test).await;
|
|
masked_email::test(&mut test).await;
|
|
security::test(&mut test).await;
|
|
quota::test(&mut test).await;
|
|
purge::test(&mut test).await;
|
|
delivery::test(&mut test).await;
|
|
crypto::test(&mut test).await;
|
|
antispam::test(&mut test).await;
|
|
undelete::test(&mut test).await;
|
|
task::test(&mut test).await;
|
|
|
|
if test.is_reset() {
|
|
test.temp_dir.delete();
|
|
}
|
|
}
|