# A Bug in Fly.io's Rust Anycast Router

DevFeed: [A Bug in Fly.io's Rust Anycast Router](<https://devfeed.tech/articles/parking-lot-ffffffffffffffff-1714.md>)

Original publisher: [Read original article](<https://fly.io/blog/parking-lot-ffffffffffffffff/>)

Published: 2025-05-28T00:00:00Z

Content type: article

Language: en

Sources: [The Fly Blog](<https://devfeed.tech/sources/the-fly-blog.md>)

Topics: [fly.io](<https://devfeed.tech/topics/fly-io.md>), [Rust](<https://devfeed.tech/topics/rust.md>), [networking](<https://devfeed.tech/topics/networking.md>), [Tokio](<https://devfeed.tech/topics/tokio.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [cdn](<https://devfeed.tech/tags/cdn.md>), [close-to-users](<https://devfeed.tech/tags/close-to-users.md>), [deploy-app-servers](<https://devfeed.tech/tags/deploy-app-servers.md>), [docker](<https://devfeed.tech/tags/docker.md>), [elixir](<https://devfeed.tech/tags/elixir.md>), [fly](<https://devfeed.tech/tags/fly.md>), [fly-io](<https://devfeed.tech/tags/fly-io.md>), [heroku-alternative](<https://devfeed.tech/tags/heroku-alternative.md>), [heroku-competitor](<https://devfeed.tech/tags/heroku-competitor.md>), [hosting](<https://devfeed.tech/tags/hosting.md>), [i](<https://devfeed.tech/tags/i.md>), [network](<https://devfeed.tech/tags/network.md>), [networking](<https://devfeed.tech/tags/networking.md>), [postgresql-clusters](<https://devfeed.tech/tags/postgresql-clusters.md>), [proxy](<https://devfeed.tech/tags/proxy.md>), [rust](<https://devfeed.tech/tags/rust.md>), [servers](<https://devfeed.tech/tags/servers.md>), [tokio](<https://devfeed.tech/tags/tokio.md>)

## AI overview

Fly.io describes a bug in fly-proxy, its Rust Anycast router. The post explains the challenge of distributing rapidly changing routing state for apps and connections across its infrastructure.

## Source excerpt

We're Fly.io, a public cloud that runs apps in a bunch of locations all over the world. This is a post about a gnarly bug in our Anycast router, the largest Rust project in our codebase. You won't need much of any Rust to follow it. The basic idea is simple: customers give us Docker containers, and tell us which one of 30+ regions around the world they want them to run in. We convert the containers into lightweight virtual machines, and then link them to an Anycast network. If you boot up an app here in Sydney and Frankfurt, and a request for it lands in Narita, it'll get routed to Sydney. The component doing that work is called fly-proxy. It's a Rust program, and it has been ill behaved of late. Dramatis Personae fly-proxy, our intrepid Anycast router. corrosion, our intrepid Anycast routing protocol. Rust, a programming language you probably don't use. read-write locks, a synchronization primitive that allows for many readers or one single writer. parking_lot, a well-regarded optimized implementation of locks in Rust. Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing Mathewson 6:31 Anycast Routing You already know how to build a proxy. Connection comes in, connection goes out, copy back and forth. So for the amount of time we spend writing about fly-proxy, you might wonder what the big deal is. To be fair, in the nuts and bolts of actually proxying requests, fly-proxy does some interesting stuff. For one thing, it's written in Rust, which is apparently a big deal all on its own. It's a large, asynchronous codebase that handles multiple protocols, TLS termination, and certificate issuance. It exercises a lot of Tokio features. But none of this is the hard part of fly-proxy. We operate thousands of servers around the world. A customer Fly Machine might get scheduled onto any of them; in some places, the expectation we set with customers is that their Machines will potentially start in l