Programmer XiaoFu
Author

Programmer XiaoFu

xiaofucode.com – a programmer learning guide driven by the pursuit of profit

108
Articles
0
Likes
140
Views
0
Comments
Recent Articles

Latest from Programmer XiaoFu

100 recent articles max
Programmer XiaoFu
Programmer XiaoFu
Jun 11, 2026 · Cloud Native

Why Does Feign’s 3‑Second Timeout Actually Take 10 Seconds? The Hidden Role of Ribbon

Feign may be set to a 3‑second timeout, but in Spring Cloud versions before 2020.0 the call is handled by Ribbon, whose default 5‑second read timeout and a single retry to another instance double the wait, producing a consistent 10‑second timeout; the article details this behavior and shows how to configure Ribbon, upgrade Spring Cloud, or use a circuit‑breaker to enforce the intended timeout.

FeignLoad BalancerRibbon
0 likes · 8 min read
Why Does Feign’s 3‑Second Timeout Actually Take 10 Seconds? The Hidden Role of Ribbon
Programmer XiaoFu
Programmer XiaoFu
Jun 8, 2026 · Artificial Intelligence

Why Smart LLMs Still Struggle to Deploy Agents in Production

Although large language models have become more capable, deploying AI agents in production remains difficult because their probabilistic nature leads to error accumulation, testing challenges, fragile real‑world interactions, and a lack of deterministic controls, requiring strict workflows, schema validation, mock testing, and human oversight.

AI AgentsLLMProduction
0 likes · 8 min read
Why Smart LLMs Still Struggle to Deploy Agents in Production
Programmer XiaoFu
Programmer XiaoFu
Jun 1, 2026 · Databases

Why Does an OR Between Two Indexed Columns Still Trigger a Full Table Scan?

Even though the phone and email columns each have a single‑column index, an OR condition forces MySQL's cost‑based optimizer to choose a full table scan because the estimated cost of index merge (random I/O and possible sort‑union) exceeds the cost of a sequential scan, and the article explains the underlying mechanics and practical workarounds.

MySQLOR queryQuery Optimization
0 likes · 10 min read
Why Does an OR Between Two Indexed Columns Still Trigger a Full Table Scan?
Programmer XiaoFu
Programmer XiaoFu
May 29, 2026 · Backend Development

Why Does Spring Use a Third-Level Cache When the Second-Level Cache Can Resolve Circular Dependencies?

Spring’s bean factory uses a three‑level cache—singletonObjects, earlySingletonObjects, and singletonFactories—to handle circular dependencies, but only the third level is needed when AOP proxies are involved, allowing lazy proxy creation without breaking the standard bean lifecycle.

AOPBean LifecycleCircular Dependency
0 likes · 9 min read
Why Does Spring Use a Third-Level Cache When the Second-Level Cache Can Resolve Circular Dependencies?
Programmer XiaoFu
Programmer XiaoFu
May 27, 2026 · Backend Development

Why Does a ThreadPool Queue Tasks Even When Max Threads Are Idle?

The article explains why Java's ThreadPoolExecutor places tasks into a queue before creating non‑core threads, discusses the cost of thread creation and CPU contention, illustrates the design with a bank‑counter analogy, and shows how Tomcat customizes the queue to prioritize thread creation for low‑latency web workloads.

Java ConcurrencyTaskQueueThread pool design
0 likes · 8 min read
Why Does a ThreadPool Queue Tasks Even When Max Threads Are Idle?
Programmer XiaoFu
Programmer XiaoFu
May 19, 2026 · Backend Development

Why Does TraceId Get Mixed Up Under High Concurrency Even Though the Parent Thread Passes It to Child Threads?

The article explains why InheritableThreadLocal fails to propagate TraceId correctly in thread‑pool scenarios under high load, illustrates the problem with concrete request examples, and presents manual propagation and Alibaba's TransmittableThreadLocal as solutions.

InheritableThreadLocalJava ConcurrencyThreadPoolExecutor
0 likes · 7 min read
Why Does TraceId Get Mixed Up Under High Concurrency Even Though the Parent Thread Passes It to Child Threads?
Programmer XiaoFu
Programmer XiaoFu
May 8, 2026 · Backend Development

Can Java 21 Virtual Threads Render Thread Pools Obsolete?

The article examines how Java 21’s cheap virtual threads change the role of traditional thread pools, explaining why pooling virtual threads is a bad idea, how thread pools still act as natural throttlers, and which scenarios—especially CPU‑bound work and synchronized blocks—remain unsuitable for virtual threads.

JDK 21JavaPinning
0 likes · 8 min read
Can Java 21 Virtual Threads Render Thread Pools Obsolete?
Programmer XiaoFu
Programmer XiaoFu
May 6, 2026 · Cloud Native

Why Add an API Gateway for Internal Services When Direct Connection Is Possible?

The article explains why, despite the apparent speed of direct internal service calls, using an API gateway provides essential benefits such as unified governance, version‑aware routing, protocol translation, security isolation, and high‑availability traffic buffering, making it a worthwhile trade‑off in most microservice environments.

API gatewayInternal NetworkProtocol Translation
0 likes · 7 min read
Why Add an API Gateway for Internal Services When Direct Connection Is Possible?