惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
About on SuperTechFans
Cloudbric
Cloudbric
C
CERT Recently Published Vulnerability Notes
G
GRAHAM CLULEY
V
Vulnerabilities – Threatpost
C
Cisco Blogs
T
Tenable Blog
P
Privacy International News Feed
T
The Exploit Database - CXSecurity.com
I
Intezer
AWS News Blog
AWS News Blog
IT之家
IT之家
博客园 - 司徒正美
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 【当耐特】
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Spread Privacy
Spread Privacy
S
SegmentFault 最新的问题
博客园 - Franky
人人都是产品经理
人人都是产品经理
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
V
Visual Studio Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
H
Hacker News: Front Page
Latest news
Latest news
Scott Helme
Scott Helme
腾讯CDC
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
A
Arctic Wolf
S
Securelist
雷峰网
雷峰网
The GitHub Blog
The GitHub Blog
Project Zero
Project Zero
Google DeepMind News
Google DeepMind News
P
Palo Alto Networks Blog
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
云风的 BLOG
云风的 BLOG
Security Archives - TechRepublic
Security Archives - TechRepublic
The Last Watchdog
The Last Watchdog
WordPress大学
WordPress大学
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 最新话题
S
Schneier on Security
NISL@THU
NISL@THU
Jina AI
Jina AI
M
MIT News - Artificial intelligence

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Async Rust Never Left MVP: I Validated It Against My Real Codebase and Found Exactly the Edge Cases That HN Post Predicted
Juan Torchia · 2026-05-07 · via DEV Community

Async Rust Never Left MVP: I Validated It Against My Real Codebase and Found Exactly the Edge Cases That HN Post Predicted

60% of projects that adopt Async Rust in production report having rewritten significant parts of their async layer within the first year. Yeah, you read that right. And that doesn't mean Async Rust is useless — it means the ecosystem promised stability before it had it, and the industry bought that promise without reading the fine print.

When I saw the HN post with 434 points arguing that Async Rust is still a glorified MVP, my immediate reaction was defensive. I'd just finished documenting Bun's jump from Zig to Rust and had built up some real enthusiasm for the language. But the post named four concrete problems: executor leaks, cancellation safety, incomprehensible error messages, and Pin hell. These weren't complaints from someone who played with it for two hours. They were scars.

So I did the only thing that makes sense when something makes you uncomfortable: I replicated it against my own code.


Async Rust in Production: What the Consensus Says and Why It Bugs Me

The consensus says Async Rust is the future of high-performance systems programming. Zero-cost abstractions, memory safety without a GC, throughput that competes with C. All of that is true. The problem is the but that comes after, which the consensus tends to whisper.

My thesis, before we get into the code: the problem isn't Async Rust as a concept. The problem is that the ecosystem promised stability in 2019 and in 2025 there are still fundamental rough edges unresolved at the language level. That has real consequences when you build something on top of that promise.

This isn't an ad hominem attack on the Rust team — it's recognizing that the marketing ran faster than the spec. And when that happens in infrastructure, you pay for it in production, not in a benchmark.


The Four Edge Cases from the Viral Post: I Replicated Them One by One

1. Executor Leaks: The One That Hurt the Most

The post argues that executor leaks are silent and hard to track down. I went straight to the part of my codebase where I use Tokio to handle concurrent connections and added explicit instrumentation.

// Measuring pending tasks in the executor — leak diagnostics
use tokio::runtime::Handle;

async fn monitor_executor() {
    // Tokio doesn't expose task metrics by default
    // You have to enable runtime metrics at build time
    let metrics = Handle::current().metrics();

    println!(
        "Active tasks: {}, Pending tasks: {}",
        metrics.num_alive_tasks(),
        metrics.remote_queue_depth()
    );
}

// The real problem: if you drop a JoinHandle without awaiting it,
// the task keeps running. No warning. No error.
// The leak is completely silent.
async fn the_silent_leak() {
    let _handle = tokio::spawn(async {
        // This task lives forever if nobody cancels it
        loop {
            tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
        }
    });
    // _handle is dropped here. The task IS STILL RUNNING.
    // Tokio doesn't tell you. No log. Nothing.
}

Enter fullscreen mode Exit fullscreen mode

I reproduced it in under ten minutes. The handle goes to drop, the task stays alive, and metrics().num_alive_tasks() climbs without any alerting system catching it by default. In my Railway logs, that translates to memory creep that took me two weeks to trace back to the right cause. I thought it was a Railway problem. It was mine.

2. Cancellation Safety: The Problem the Compiler Can't See

This is the one that hit me the hardest emotionally, if I can put it that way. Rust's compiler protects you from data races, use-after-free, everything it promised. But it doesn't protect you from cancellation unsafety in async code. It's a hole in the guarantee.

use tokio::select;
use tokio::sync::Mutex;
use std::sync::Arc;

// Example of a NOT cancellation-safe operation
// The HN post explicitly names this pattern
async fn update_balance(
    db: Arc<Mutex<Vec<i64>>>,
    amount: i64,
) {
    let mut data = db.lock().await; // <-- cancellation point
    // If the task is cancelled HERE, after the lock but before
    // the write, you leave the mutex poisoned or the state inconsistent.
    // The compiler doesn't warn you. That's your problem.
    data.push(amount);
    // Second operation: if there's cancellation between the two,
    // the business invariant breaks silently
    data.push(-amount); // compensation that never arrives
}

async fn usage_with_timeout() {
    let db = Arc::new(Mutex::new(vec![]));

    select! {
        // If the timeout wins, update_balance gets cancelled
        // at any suspension point. No guarantees.
        _ = update_balance(db.clone(), 100) => {},
        _ = tokio::time::sleep(tokio::time::Duration::from_millis(1)) => {
            println!("Timeout — db state: unknown");
        }
    }
}

Enter fullscreen mode Exit fullscreen mode

The HN post calls this a fundamental design flaw, not a fixable bug. After replicating it, I agree. tokio::select! is powerful, but the cancellation semantics aren't specified at the language level — they're delegated to each library to document whether its functions are "cancellation safe." In practice that means you have to read the documentation for every .await you use. In a real project with 40+ async dependencies, that doesn't scale.

3. Error Messages: The Compiler That Lies by Omission

The fairest thing I can say about this part of the post: Async Rust error messages aren't bad because of lack of effort. They're bad because the mental model they expose doesn't match what the developer is thinking about. It's a semantics problem, not a team effort problem.

// This code produces an error that takes 15 minutes to understand
// the first time you see it
use std::future::Future;

fn i_need_a_future<F: Future<Output = ()>>(f: F) {
    // Intentionally incomplete to show the error
}

// Real error I got in my codebase:
// error[E0277]: `*mut ()` cannot be sent between threads safely
// within `impl Future<Output = ()>`, the trait `Send` is not implemented
// for `*mut ()`
// note: future is not `Send` as this value is used across an await
// ...and then 40 more lines of context that don't help
async fn my_function_with_raw_ptr() {
    let ptr: *mut () = std::ptr::null_mut();
    tokio::time::sleep(tokio::time::Duration::from_millis(1)).await;
    // ptr is used after the await — Send not guaranteed
    let _ = ptr;
}

Enter fullscreen mode Exit fullscreen mode

The error I got when I did something similar in production had 47 lines. The actual cause was on line 34 of the output. That's not an exaggeration — I counted.

4. Pin Hell: The Abstraction That Leaked

Pin<Box<dyn Future>> is where Async Rust shows its seams to anyone coming from a GC language. The HN post argues that Pin is a solution to a problem that shouldn't exist at the public API level. After replicating it, I think it's right on the diagnosis but underestimates why it was necessary.

use std::pin::Pin;
use std::future::Future;

// This is what you end up writing when you want to
// store heterogeneous futures — something trivial in Go
type BoxedFuture = Pin<Box<dyn Future<Output = Result<String, Box<dyn std::error::Error>>> + Send>>;

struct AsyncProcessor {
    // You can't do Vec<impl Future<...>> — you have to box
    tasks: Vec<BoxedFuture>,
}

impl AsyncProcessor {
    fn add_task<F>(&mut self, fut: F)
    where
        F: Future<Output = Result<String, Box<dyn std::error::Error>>> + Send + 'static,
    {
        // The Box + Pin is the price of the zero-cost abstraction
        // that in this case has a very visible cost
        self.tasks.push(Box::pin(fut));
    }
}

Enter fullscreen mode Exit fullscreen mode

The first time I wrote something like this in my codebase I stopped for ten minutes asking myself if I was doing something fundamentally wrong. I wasn't. It's the correct pattern. That's the uncomfortable part.


The Mistakes I Made (That the HN Post Doesn't Mention)

The viral post is fair in what it criticizes but leaves out something important: many of these edge cases are generated by you, not the language. That doesn't absolve the ecosystem, but it changes the diagnosis.

In my case, the two most expensive mistakes were:

Mistake 1: Using Tokio like it was Node.js. I came from the JavaScript world where the event loop is an implementation detail. In Tokio, the executor model matters and you have to think about it from the design phase. When I treated it as a black box, the leaks I mentioned started showing up.

Mistake 2: Trusting that "if it compiles, it works" applies to async code. In synchronous Rust, that heuristic takes you far. In Async Rust, the compiler verifies fewer invariants. Cancellation safety, task leaks, and certain operation orderings fall outside what the borrow checker can see. It's an expansion of the implicit contract that nobody warns you you just signed.

This reminds me of what I documented when an agent deleted my production database: the tool didn't fail, I assumed guarantees the tool never offered.


FAQ: Async Rust Production Problems

Does Async Rust have more bugs than Async Go or Async Python?

Not necessarily more bugs — but the bugs are harder to diagnose. Go has a simpler concurrency model (goroutines + channels) that isolates errors better. Python asyncio has its own problems, but the errors tend to be more readable. Rust gives you more control and more rope to hang yourself with.

Is Async Rust worth using in production today, in 2025?

Yes, with conditions. If you have a team that understands the executor model, that documents the cancellation safety of their functions, and that isn't going to iterate fast on the async layer, it's worth it. If you're prototyping or have a team with mixed Rust experience, the onboarding cost is real and you will pay it.

What's the practical alternative if Async Rust has these problems?

Depends on the case. For high-performance networking: async Rust is still hard to beat on raw throughput. For applications where concurrency isn't the bottleneck: Go is more honest about its trade-offs. For fast scripting with I/O: Python asyncio with httpx gets the job done without the cognitive overhead.

Does the 434-point HN post exaggerate?

On the diagnosis, no. On the prescription, yes. Saying Async Rust "isn't ready" is an oversimplification — it's ready for specific use cases with prepared teams. Saying it's a glorified MVP captures the feeling of someone who hits these edge cases, but doesn't reflect that there's real, stable production code built on top of it.

How does it compare to the hidden complexity I found when training an LLM from scratch?

Surprisingly similar in pattern: in both cases, the tutorial or announcement promises something that works, and the real complexity appears when you leave the happy path. With the LLM it was hidden infrastructure costs. With Async Rust, it's the guarantees the compiler doesn't give and nobody documents clearly.

Will Pin improve in future versions of Rust?

The Pin<T> ergonomics proposal has been in discussion on the RFC tracker for years. There's real progress — the pin! macro improved ergonomics in some cases. But the underlying problem (that memory movement and self-referential structs are conceptually hard) doesn't disappear with syntax sugar. The Rust team knows it and is working on it, but there's no concrete date for a complete solution.


My Take: What I Accept, What I Don't Buy, and What I'd Do Differently

I accept that Async Rust has the problems the post describes. I replicated them, measured them, and suffered through them in production before I understood what they were.

I don't buy the narrative that it's "broken." It's incomplete in its ergonomics. It's different, and that difference carries a real cost that the ecosystem underestimated in its communication.

What I'd do differently: I would never adopt Async Rust without first explicitly documenting which parts of my system depend on cancellation safety, and without adding Tokio runtime metrics from day one. That's not a workaround — it's production hygiene that the official onboarding doesn't emphasize enough.

I'd also be more upfront with my team from the start. When I analyzed the tar problems between macOS and Linux in my Railway pipeline, the lesson was the same: the tool does what the docs say. The problem is what the docs assume you already know.

The HN post is right about something nobody in the Rust ecosystem wants to say out loud: you promised production-ready when you were still-figuring-it-out, and that trust cost doesn't recover just by shipping new features. The same thing happened with Chrome installing AI models without permission — the problem isn't the technology, it's the promise wrapped around it.

Async Rust is going to be fine. The ecosystem will mature. But in 2025, if you're starting a new project and someone sells you async Rust as "already solved," ask them to show you their cancellation handling code. That's where you'll see what state it's really in.


Source: Hacker News


This article was originally published on juanchi.dev