SShortSingh.
Back to feed

How to Build a Leak-Safe gRPC Frame Decoder Using Reactor Netty

0
·1 views

A developer building a custom gRPC runtime on Reactor Netty has detailed the design of a Stage 1 protocol layer: a frame decoder that safely parses gRPC's five-byte message envelope without assuming buffer boundaries align with message boundaries. The decoder uses Flux.defer to give each subscription its own independent decoder instance, preventing shared mutable state across concurrent streams. A deliberate copy-based encoding approach was chosen over zero-copy to make ownership boundaries easier to reason about and verify during cancellation or error scenarios. Every source buffer is explicitly released via doFinally, covering success, failure, and cancellation paths to prevent memory leaks. The author notes the project has advanced beyond this stage, but the ownership and bounded-decoding rules established here remain foundational to subsequent transport layers.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Ukraine-Poland freight crossing logged 4-day wait as border delays upend EU logistics

On July 16, 2026, the Yahodyn–Dorohusk crossing on the Ukraine-Poland border recorded a wait of nearly 5,964 minutes for loaded trucks, with over 1,000 vehicles queued. Data from Ukraine's electronic border queue system, eCherha, showed that across 38 truck checkpoints on Ukraine's EU-facing frontier, wait times clustered at either zero or several days, with almost no middle ground. This bimodal pattern means standard ETA padding based on averages is largely useless for freight planners routing through external EU borders. Ukraine's State Customs Service publishes live checkpoint data as open data under CC BY 4.0, covering queues toward five neighboring countries. The dataset has been integrated into the NAPSPAN API, allowing logistics systems to query real-time wait times and queue depths for specific crossings and vehicle types.

0
ProgrammingDEV Community ·

AI Wildlife Videos Risk Warping Public Perception of Nature, Study Warns

A peer-reviewed study published on September 3, 2025, in Conservation Biology warns that realistic AI-generated wildlife images and videos can distort public understanding of animal behavior and the natural world. The research highlights how fabricated scenes — such as leopards appearing in backyards or animals displaying human-like motivations — can circulate on social media and be mistaken for authentic documentation. Because wildlife media often serves an informal educational role, false depictions could undermine public support for conservation, habitat protection, and responsible human-wildlife interactions. The authors note that high realism makes synthetic misinformation harder to detect, especially for viewers lacking specialist species knowledge. The study calls for a combined response involving media literacy education, platform disclosure practices, and governance measures to prevent AI-generated content from being treated as factual wildlife evidence.

0
ProgrammingDEV Community ·

Simple Habits That Can Significantly Cut Your Monthly Cloud Bill

Cloud costs often run higher than expected not because of provider pricing but due to poor resource management habits, according to a developer writing on DEV Community. Oversized instances running at low CPU utilization for months are among the biggest culprits, and quarterly rightsizing reviews can eliminate unnecessary spend. Development and staging environments that run around the clock but go unused after business hours are another major source of waste, with scheduled shutdowns via cron jobs or cloud functions offering an easy fix. Teams should also evaluate whether managed services like RDS are truly necessary, as self-hosted alternatives can sometimes halve the cost for comparable workloads. Setting up tiered billing alerts at 50%, 80%, and 100% of a defined budget is recommended as a baseline practice to avoid unexpected cost spikes.

0
ProgrammingDEV Community ·

Layered SQL Workflow Helps SaaS Teams Build Reliable, Consistent Reporting

SaaS teams often run into conflicting metrics when multiple team members query raw production tables independently, each applying slightly different logic and filters. This inconsistency erodes trust in dashboards and creates confusion over which numbers are correct. A three-layer SQL workflow — raw tables, cleaned staging views, and business-level data marts — addresses this by centralizing transformation and metric definitions in one place. The approach mirrors the medallion architecture used in data engineering and requires only standard SQL views on an existing Postgres or MySQL database, with no data warehouse needed. By having all reports draw from shared staging views and marts, teams ensure test accounts are excluded, amounts are standardized, and key metrics like MRR have a single, authoritative definition.

How to Build a Leak-Safe gRPC Frame Decoder Using Reactor Netty · ShortSingh