Principle:Apache Dolphinscheduler Synchronous RPC Execution
| Knowledge Sources | |
|---|---|
| Domains | Distributed_Systems, RPC |
| Last Updated | 2026-02-10 00:00 GMT |
Overview
A synchronous request-response RPC execution mechanism that serializes method calls into wire-format Transporter messages, sends them over Netty channels, and blocks until a response is received or timeout occurs.
Description
The Synchronous RPC Execution principle defines how DolphinScheduler executes blocking remote procedure calls. When a method is called on an RPC proxy, the invocation handler creates a StandardRpcRequest containing the serialized arguments, wraps it in a Transporter with a header identifying the target method, and sends it via NettyRemotingClient. The client creates a ResponseFuture that blocks the calling thread until the server sends back a response or the configured timeout expires.
The Transporter is the wire-format message containing a TransporterHeader (with method identification, opaque ID for request correlation) and a body of serialized bytes. The JsonSerializer handles serialization and deserialization of request/response payloads.
Usage
This principle is used implicitly whenever an RPC method is called through a client proxy. The synchronous execution model is appropriate for request-response patterns where the caller needs the result before proceeding (e.g., workflow triggering, task dispatch).
Theoretical Basis
The Synchronous RPC Execution implements a Request-Response Pattern with Future-based blocking:
// Execution flow
sendSync(syncRequestDto):
channel = getOrCreateChannel(host) // Netty channel (reconnect if needed)
transporter = serialize(request) // Method ID + args -> Transporter
responseFuture = new ResponseFuture(opaque) // Create blocking future
channel.writeAndFlush(transporter) // Send over wire
response = responseFuture.get(timeout) // Block until response
return deserialize(response) // Transporter -> result object