Skip to content

drpcquic: add QUIC transport for drpc using quic-go#63

Draft
eshwarsriramoju wants to merge 15 commits into
cockroachdb:mainfrom
eshwarsriramoju:feat/drpc-quic
Draft

drpcquic: add QUIC transport for drpc using quic-go#63
eshwarsriramoju wants to merge 15 commits into
cockroachdb:mainfrom
eshwarsriramoju:feat/drpc-quic

Conversation

@eshwarsriramoju

Copy link
Copy Markdown
  • Adds a MultiplexedTransport interface to drpc for connections that can open/accept independent bidirectional streams (e.g. QUIC)
  • Introduces drpcquic package with Dial, Listen, Serve, and a Transport wrapper around quic.Stream (FIN-aware close + error mapping)
  • Adds QUICManager in drpcmanager for one-stream-per-RPC multiplexed mode, and NewForReader/readLoop in drpcstream so each stream owns its transport
  • Extends drpcconn.Conn with NewFromMultiplexed to support concurrent Invoke calls (each on its own QUIC stream)
    Adds ServeMultiplexed in drpcserver for concurrent server-side RPC handling
    Includes end-to-end tests (streaming, concurrency, cancellation, server-death, leak detection) and a runnable demo in cmd/quicdemo

Comment thread drpcmanager/quic_manager.go
Comment thread drpcquic/errors.go
Add a QUIC Server type whose Serve(ctx, *Listener) method mirrors
(*drpcserver.Server).Serve, so it fits callers that hold a server and
call Serve(ctx, lis). The free Serve stays as a wrapper. Add ListenPacket
for a caller-owned UDP socket.
The accept loop read each stream's invoke before accepting the next, so a
stream slow to send its invoke blocked every later stream on the
connection. Split AcceptStream (loop) from the invoke read (per-stream
goroutine), isolate per-stream parse errors, and order shutdown
Cancel->Close->Wait so a stream stalled mid-invoke can't hang drain.
mapQUICError let context.DeadlineExceeded fall into the net.Error timeout
catch-all, wrapping it as ClosedError so ToRPCErr returned Unavailable.
Return the bare sentinel before the catch-all; ToRPCErr matches it by
value and yields codes.DeadlineExceeded.
…rns nil

Mirror ServeOne's TLS peer-info: read the verified chain off the QUIC
connection and set drpcctx.PeerConnectionInfo before ServeMultiplexed so
handlers (auth) see peer identity. Serve now returns nil on clean stop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants