madsim
Deterministic Simulator for distributed systems.
0.2.34
6.4M downloads/mo
#3998 most downloaded on crates.io
madsim-rs/madsim
What this package is like to depend on
Last release 10 months ago
11 Oct 2025
Release timing varies
gaps range from 9 days to 8 months
Nearly every release is documented
notes for 39 of 39 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
46 releases · first in 2021
1 release in the last 12 months
see the full history below
Release timeline
46 releases · Aug 2021 to Oct 2025Releases
latest 46-
0.2.3411 Oct 2025Release notes
Open source →Changed
- Name of the default node is changed from
maintomadsim-main. libc::gethostnamenow returns the name of the current node, ormadsim-node-{id}if it's unnamed.
- Name of the default node is changed from
-
0.2.3331 Jul 2025 -
0.2.3224 Jun 2025 -
0.2.3118 Oct 2024 -
0.2.3006 Jun 2024Release notes
Open source →Removed
- Remove
Handle::spawnandHandle::spawn_blockingas the implementation is incorrect.
- Remove
-
0.2.2927 May 2024Release notes
Open source →Added
- Implement
DebugforHandleandAbortHandle.
Fixed
- When
MADSIM_ALLOW_SYSTEM_THREADis set, executor won't panic when no task is ready.
- Implement
-
0.2.2817 May 2024 -
0.2.2707 Apr 2024 -
0.2.2618 Mar 2024Release notes
Open source →Added
- Add a fake
runtime::Handle. Note that this is a re-export ofmadsim::task::Handle. Tasks spawned with this handle are not correctly associated with the tokio runtime.
- Add a fake
-
0.2.2526 Feb 2024 -
0.2.2406 Jan 2024Release notes
Open source →- fix time on x86_64 macos
Signed-off-by: Runji Wang [email protected]
- add path to madsim deps
Signed-off-by: Runji Wang [email protected]
- update deps for madsim
Signed-off-by: Runji Wang [email protected]
Signed-off-by: Runji Wang [email protected]
-
0.2.2327 Oct 2023Release notes
Open source →Fixed
- madsim: Return an error instead of panicking when
lookup_hostreceives an invalid address.
- madsim: Return an error instead of panicking when
-
0.2.2219 Apr 2023Release notes
Open source →- add restart_on_panic_matching
Signed-off-by: Runji Wang [email protected]
- bump version
Signed-off-by: Runji Wang [email protected]
Signed-off-by: Runji Wang [email protected]
Release notes
Open source →Added
- madsim: Add
restart_on_panic_matchingto support auto restarting on panic with certain messages.
-
0.2.2114 Apr 2023Release notes
Open source →- tonic: fix panic on connection reset
Signed-off-by: Runji Wang [email protected]
- bump version
Signed-off-by: Runji Wang [email protected]
Signed-off-by: Runji Wang [email protected]
Release notes
Open source →Added
- madsim: Add
time::advance.
Fixed
- tonic: Fix panic on bi-directional streaming server closed.
-
0.2.2013 Apr 2023Release notes
Open source →- add metric num_tasks_by_node_by_spawn
Signed-off-by: Runji Wang [email protected]
- record task spawn time
Signed-off-by: Runji Wang [email protected]
- don't spawn task for connection
Signed-off-by: Runji Wang [email protected]
- etcd: fix server task leak
Signed-off-by: Runji Wang [email protected]
- fix clippy
Signed-off-by: Runji Wang [email protected]
- bump version
Signed-off-by: Runji Wang [email protected]
- tonic: drop RPC task on client closed
Signed-off-by: Runji Wang [email protected]
Signed-off-by: Runji Wang [email protected]
Release notes
Open source →Added
- madsim: Add detailed metrics for tasks.
Changed
- madsim: Avoid spawning tasks for connection.
Fixed
- madsim: Fix leak of task introduced in 0.2.19.
- tonic: Fix leak of RPC task in server.
-
0.2.1907 Apr 2023Release notes
Open source →Added
- madsim: Print context information on panic.
- madsim: Add
AbortHandle. - madsim: Add
RuntimeMetrics. - tokio: Support dropping
Runtime.
Changed
- madsim: Futures of a killed node are dropped after a while.
-
0.2.1808 Mar 2023Release notes
Open source →- tonic: fix the error when server stream is broken
Signed-off-by: Runji Wang [email protected]
- update CHANGELOG
Signed-off-by: Runji Wang [email protected]
- release v0.2.18
Signed-off-by: Runji Wang [email protected]
Signed-off-by: Runji Wang [email protected]
Release notes
Open source →Added
- tonic: Support request timeout.
Fixed
- madsim: Replace
SmallRngwithXoshiro256PlusPlusfor reproducibility across platforms. - tonic: Return an error when the server stream is broken.
-
0.2.1717 Feb 2023Release notes
Open source →- remove printing
MADSIM_CONFIG_HASHto avoid confusion
Signed-off-by: Runji Wang [email protected]
- s3: make fields public for
*Output
Signed-off-by: Runji Wang [email protected]
- bump version to v0.2.17
Signed-off-by: Runji Wang [email protected]
- mention patching tokio-stream in README
Signed-off-by: Runji Wang [email protected]
Signed-off-by: Runji Wang [email protected]
Release notes
Open source →Fixed
- madsim: Prevent deadlock when killing a node.
- s3: Make fields public for
*Outputstructs.
- remove printing
-
0.2.1614 Feb 2023Release notes
Open source →- fix clock_id=7
Signed-off-by: Runji Wang [email protected]
- add changelog and bump version
Signed-off-by: Runji Wang [email protected]
- s3: don't return error when deleted object is not found
Signed-off-by: Runji Wang [email protected]
- add changelog
Signed-off-by: Runji Wang [email protected]
Signed-off-by: Runji Wang [email protected]
Release notes
Open source →Fixed
- madsim: Fix
clock_gettime(CLOCK_BOOTTIME = 7)on Linux. - s3: Don't return error when deleted object is not found.
-
0.2.1507 Feb 2023Release notes
Open source →Added
- madsim: Add
buggify. - madsim: Add
JoinHandle::{id, is_finished}. - madsim: Add
signal::ctrl_candHandle::send_ctrl_c. - madsim: Add
Handle::is_exit. - Add S3 simulator.
Changed
- madsim: After the initial task completes, the other tasks of the node are dropped.
- madsim: Add
-
0.2.1430 Jan 2023Release notes
Open source →Added
- madsim: Add
NetSim::add_dns_record. - madsim: Add a global IPVS for load balancing.
Fixed
- tonic/rdkafka: Resolve DNS on connection.
- madsim: Add
-
0.2.1309 Jan 2023 -
0.2.1213 Dec 2022Release notes
Open source →Changed
- madsim: No longer initialize the global logger on
#[main]or#[test].
Fixed
- madsim: Fix
Instantinterception on ARM64 macOS caused by change in Rust nightly.
- madsim: No longer initialize the global logger on
-
0.2.1102 Dec 2022Release notes
Open source →Added
- tokio: Add
task::Builder::new_current_threadbut panic inside. - tonic: Add
servicemodule andExtensions. - tonic: Support interceptor.
Fixed
- tonic: Fix passing metadata in request and response. Add
content-typeanddatefield. - tonic: Fix panic on unimplemented error.
- tokio: Add
-
0.2.1009 Nov 2022 -
0.2.928 Oct 2022Release notes
Open source →Fixed
- madsim: Fix internal structure change of nightly
std::time::{SystemTime, Interval}.
- madsim: Fix internal structure change of nightly
-
0.2.826 Sep 2022 -
0.2.713 Sep 2022Release notes
Open source →Added
- tokio: Add fake
Runtime.
Changed
- madsim: Change the default seed to the nanosecond of current time.
- madsim: Wait for a while after panicking before restart.
Fixed
- madsim: Avoid closing socket of a restarted node.
- tokio: Add fake
-
0.2.605 Sep 2022Release notes
Open source →Added
- madsim: Add hook function for RPC.
Removed
- madsim: Deprecate
Network::(dis)connect(2)functions. Rename them to(un)clog_*.
-
0.2.502 Sep 2022Release notes
Open source →Changed
- madsim: Forbid creating system thread in simulation.
- madsim: Drop futures on killing node.
- madsim: Make
Endpointclonable.
-
0.2.425 Aug 2022Release notes
Open source →Fixed
- madsim: Fix panic from minstant crate on Linux virtual machine.
- tonic: Fix panic when server sends a response but client has closed the stream.
-
0.2.324 Aug 2022 -
0.2.224 Aug 2022Release notes
Open source →Added
- madsim: Add
task::BuilderAPI. - madsim: Support auto restarting a node on panic.
Changed
- madsim: Rename
TaskNodeHandletoSpawner.
Removed
- madsim: Deprecate
spawn_blocking.
- madsim: Add
-
0.2.119 Aug 2022Release notes
Open source →Added
- madsim: Add basic
net::UdpSocket.
Changed
- madsim: Refactor network simulator with a new connection primitive.
- madsim: Migrate logging facility to
tracing. Replaceenv_loggerwithtracing-subscriber. - madsim: Migrate std lock to spin lock.
- tonic: Reduce dependencies in simulation build.
Fixed
- madsim: Fix the address of
TcpStreamaccepted fromTcpListener. - madsim: Fix the socket address space. A TCP and a UDP sockets can have the same address in a node.
- tonic: Close the stream when the connection is broken.
- madsim: Add basic
-
0.2.010 Aug 2022Release notes
Open source →Added
- madsim-tonic: Add missing methods of
EndpointandServer.
Fixed
- madsim-tokio:
#[tokio::main]no longer requires madsim crate.
Removed
- madsim: Remove
collectionsmodule since we can use std's directly.
- madsim-tonic: Add missing methods of
-
0.2.0-alpha.706 Aug 2022 pre-releaseRelease notes
Open source →Added
- madsim: Allow user to set the number of CPU cores and simulate
std::thread::available_parallelism. - madsim: Add
MADSIM_TEST_JOBSenvironment variable to set the number of jobs to run simultaneously. - madsim: Introduce runtime
Builder. - madsim: Expose seed via
Handle::seed.
Fixed
- madsim: Fix the local address after bind
0.0.0.0. - madsim-tonic: Client connecting to an invalid address should return error.
Removed
- madsim: Remove
Runtime::{enable_determinism_check, take_rand_log}. Replaced bycheck_determinism.
- madsim: Allow user to set the number of CPU cores and simulate
-
0.2.0-alpha.601 Aug 2022 pre-releaseRelease notes
Open source →Added
-
Make deterministic on
randandstd::{collections::{HashMap, HashSet}, time::{SystemTime, Instant}}.Exception:
randis not deterministic on linux. usemadsim::randinstead.
Changed
- madsim-macros: Every simulation now runs on a new thread to ensure the determinism.
- madsim-tonic: Update tonic to v0.8. Additional system protoc is required.
-
-
0.2.0-alpha.526 Jul 2022 pre-releaseRelease notes
Open source →Added
- Migrate a new crate
madsim-tokio-postgresfor simulation. - madsim-tokio: Add
task_local,task::LocalKey,signal::ctrl_c. - madsim-tonic: Support
Request::remote_addrand returning error from server.
Fixed
- madsim: Refactor TCP simulator and fix several bugs. (#18)
- madsim: Avoid some panics on panicking.
- Migrate a new crate
-
0.2.0-alpha.418 Jul 2022 pre-releaseRelease notes
Open source →Added
- madsim: Add TCP simulation.
- madsim-tokio: Add
task::consume_budgetandtask::Id.
Fixed
- madsim: Avoid duplicate connection and close unused connection on TCP.
- madsim-tokio: Fix
fullfeature.
-
0.2.0-alpha.325 May 2022 pre-releaseRelease notes
Open source →Added
- madsim: Add serde API to
HashMap. - madsim-norandom: A preview library for intercepting libc
getrandom.
Changed
- Breaking: Change the way to enable simulation:
#[cfg(feature = "sim")]->#[cfg(madsim)].
Fixed
- Lock version on madsim dependencies to prevent API broken.
- madsim: Add serde API to
-
0.2.0-alpha.221 May 2022 pre-releaseRelease notes
Open source →Added
- Add a new crate
madsim-tokiofor tokio simulation. - madsim/sim: Add
time::intervalandtask::yield_now. - madsim/sim: Complete methods for
Sleep,Elapsed,JoinErrorandJoinHandle. - madsim-tonic: Add
Server::layerbut don't implement it.
Changed
- Breaking: madsim: Switch
JoinHandleto tokio style which won't cancel task on drop. - madsim-macros: Improve error message on panic in simulation.
Fixed
- madsim: Fix TCP performance issue by setting NODELAY.
- Add a new crate
-
0.2.0-alpha.112 May 2022 pre-release -
0.1.330 Nov 2021 -
0.1.204 Nov 2021 -
0.1.124 Aug 2021Release notes
Open source →Added
- Deterministic check on test.
Changed
- Remove default time limit (300s) on test.
- Improve error message on context missing.
Fixed
- Fix double panic in the executor.
- Fix deterministic in
time::timeout.
-
0.1.022 Aug 2021Release notes
Open source →Added
- Deterministic async runtime.
- Basic simulated network and file system.