Pigeon RPC Framework Source Code Analysis
This article provides a comprehensive analysis of Pigeon, a point-based open-source RPC framework used by the company, covering its client-side invoker, server-side provider, call flows, Zookeeper integration, service isolation, and operational features.
This article provides a comprehensive analysis of Pigeon, a point-based open-source RPC framework used by the company. The framework is client-heavy and lightweight on the server side, with many strategies implemented on the client. Key features include service isolation (swim lanes/groups), load balancing, monitoring, service throttling, and service degradation.
The client-side invoker handles service adjustments through local caching without affecting other clients or Zookeeper data. The startup process involves several stages, with major class relationships and proxy-related structures detailed in diagrams. The call chain shows how ServiceInvokerFilter fits into the overall flow, with routing-related class relationships also illustrated.
The server-side provider focuses on service isolation, registration, and other functionalities. Its startup process and service registration mechanisms are explained with accompanying diagrams. Context-related class relationships and call chains are also covered.
The article details the complete call flow, showing thread relationships between client requests (t0), internal Pigeon threads (t1) using thread pools and future patterns, server-side thread pool processing, and Netty-based message handling. The client receives responses through thread pools, with sync operations being wrapped future calls.
Zookeeper serves only as a configuration service in Pigeon, with node structures explained through diagrams. Service isolation features like swim lanes (groups) are discussed, along with Jetty Console Processor for monitoring, testing, and management functions. Commands for service listing, online/offline status, and weight management are provided.
Additional topics include Region Policy Manager for IP-based regional server selection, usage recommendations addressing thread handling, circular call prevention, client-side degradation synchronization issues, testing environment upgrade challenges, call semantics, and request-level caching suggestions. The article concludes with references to external resources and author information.
Manbang Technology Team
Manbang Technology Team
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.