feat: Always run mutex assertion outside maxperf

Also makes it not a panic
This commit is contained in:
timedout committed 2026-10-16 19:26:30 +01:00
1 parent 3ebd068013
commit 13e01a6dc9
1 file changed
+12 -2
+12 -2
View File
@@ -95,8 +95,18 @@ impl super::Service {
redacts,
timestamp,
} = partial_pdu;
if state_key.is_some() {
debug_assert!(mutex_lock.is_some(), "No state mutex held while creating state event");
#[cfg(not(feature = "release_max_log_level"))]
if state_key.is_some() && mutex_lock.is_none() {
return Err!(error!(
?event_type,
?content,
?sticky,
?unsigned,
?state_key,
?redacts,
?timestamp,
"Attempted to build a state event without a state mutex lock"
));
}
trace!(