Skip to content
Merged
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
6 changes: 5 additions & 1 deletion crates/fabric-core/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1547,8 +1547,12 @@ fn event_with_metadata(
}

fn new_id(prefix: &str) -> String {
// The atomic counter only differentiates ids within a single process; a
// process-backed runner spawns a fresh `fabric-cli` per call, resetting it
// to 1. Include the process id (distinct across concurrently running
// processes) so ids stay unique when two runs land in the same millisecond.
let counter = NEXT_ID.fetch_add(1, Ordering::Relaxed);
format!("{prefix}-{}-{counter}", now_millis())
format!("{prefix}-{}-{}-{counter}", now_millis(), std::process::id())
}

fn now_millis() -> u128 {
Expand Down