parking_lot: ffffffffffffffff...
Fly.io's Rust Anycast router, fly-proxy, kept deadlocking after Catalog state was moved to lazy loading. The cause was traced to parking_lot RwLock words being set to 0xFFFFFFFFFFFFFFFF. The hunt ran from a known if-let lock-lifetime footgun through closure-scoped lock refactors with timeouts and telemetry, parking_lot's deadlock detector, gdb core-dump inspection, read_recursive experiments and miri. Core dumps showed threads waiting on a lock nobody held, and logging the raw lock word revealed every bit set, including the unused UPGRADEABLE flag. The post also covers Corrosion, Fly.io's CRDT-structured SQLite replicated over SWIM gossip, and the watchdog that bounces stuck proxies to keep deadlocks survivable.
Related posts
- Corrosion
Fly.io mediumAdeptCorrosion is Fly.io's open-source service discovery system: a Rust program that propagates a SQLite database across thousands of workers via SWIM gossip and QUIC, using the cr-sqlite CRDT extension with last-write-wins logical timestamps instead of distributed consensus. It works because Fly's orchestration makes individual workers the source of truth for their own state, so updates rarely conflict, much like a link-state routing protocol such as OSPF. The war stories cover a Rust RwLock deadlock gossiped to every proxy that caused a fleet-wide outage, a nullable-column migration that triggered a cr-sqlite backfill storm, and Consul certificate expiry that drove Corrosion writes until uplinks saturated. The fixes are Tokio event-loop watchdogs, Antithesis testing, checkpoint backups for cluster rebuilds, republishing full Machine state instead of partial updates, and regionalized two-level clusters to shrink the blast radius.
- How posix_spawn & close_range “fixed” cold starts
Neon mediumAdept
Neon's Pageserver regressed cold-start and first-query-after-idle latency to seconds after it began shutting down idle per-tenant walredo sidecar processes. Spawning them was slow because a pre_exec hook (used to mark inherited file descriptors close-on-exec) forced Rust's std::process::Command to fall back from posix_spawn to fork+exec. The real cost turned out to be the close_fds crate's fallback: CLOSE_RANGE_CLOEXEC isn't supported on Linux 5.10, so it issued one fcntl per open FD, roughly 2s across ~200k descriptors. Moving a plain close_range call into the walredo process itself cut basebackup latency from ~2s mean and ~10s p99 to the low hundreds of milliseconds.
- How to deadlock Tokio application in Rust with just a single mutex
Turso mediumAdeptA Tokio program can deadlock with a single std::sync::Mutex when a spawn_blocking task holds the lock while calling Handle::block_on on a future, and an async task on a worker thread tries to take the same lock. The likely cause is that worker threads get blocked on the mutex, so the blocked-on future cannot make progress. In effect the std mutex is held across an implicit .await point. Switching to tokio::sync::Mutex (lock().await and blocking_lock()) fixes it, and the recommendation is to default to Tokio's mutex in async code unless profiling shows it is a bottleneck, much as SeqCst should be the default over Relaxed atomics.
- May 18 Replit downtime
Replit mediumAdeptA latent Go bug leaked RWMutex read-locks whenever a configuration kind had no handler. The first write-lock attempt, during a configuration push to all clusters at once, deadlocked every Repl VM and caused about two hours of total downtime. Recovery was slowed by liveness probes that failed open, a rollback that took two tries and reset the added capacity, and an autoscaler that ignored request volume and shrank instance groups. Fixes include fast, reliable rollbacks, staggered config rollouts with jitter, self-healing health and liveness logic, and more static analysis.
- Well, That Wasn't Fun: October 16 '26
Fly.io mediumAdeptA Linux kernel bug in IPv4 checksum offload validation let a guest VM direct the host to write its computed checksum into an already-trusted IPv4 header field. This enabled a firewall bypass and a 32-byte out-of-bounds read that could leak host memory or packets from neighboring VMs. XDP rules ran too early to catch the rewrite, and disabling offload required a reboot anyway, so Fly.io patched and rebooted its entire fleet in 10 hours. Reboots were sequenced in waves so no Managed Postgres cluster lost both nodes (17 waves in iad), with some hosts stuck in BIOS or lost to a failed power supply. The write-up also covers the decision to label the work as 'maintenance' rather than disclose vulnerability, the move of incident comms to the exec team, and advice to encrypt internal traffic, scope and expire agent credentials, and rehearse rotation.