Skip to main content

Reliable client-server communication

Short answer

Reliable client-server communication handles lost requests and replies by timers, retransmission, and idempotent operations or sequence numbers. Server crash semantics are at-least-once, at-most-once, or exactly-once; client crashes are handled by extermination, reincarnation, gentle reincarnation, or expiration.

Explain reliable client-server communication.

Reliable client-server (RPC/RMI) communication deals with the following failures and how to tolerate them.

FailureSolution
Client cannot locate serverReturn an exception to the client; use a name or binding service
Lost request messageClient timer; retransmit the request after time-out
Server crashDepends on when it crashed (see below)
Lost reply messageRetransmit with idempotent operations or sequence numbers/duplicate filtering
Client crashOrphan handling

Server crash: the server may crash before executing the request or after executing it but before replying; the client cannot tell the two apart. Semantics:

  • At-least-once: the client keeps retrying until a reply arrives; the operation may run more than once (fine for idempotent operations).
  • At-most-once: the request is never repeated; if no reply, the client gets an error.
  • Exactly-once: ideal, but cannot be guaranteed in general.

Client crash (orphans): a computation running without a parent client wastes resources and may hold locks. Solutions: extermination (log each call and kill orphans after reboot), reincarnation (broadcast a new epoch; old computations are killed), gentle reincarnation (kill only if the owner cannot be found), and expiration (each call gets a time quantum T; it is killed if not finished).

For TCP-type reliable communication (point-to-point), acknowledgements, sequence numbers and retransmission give reliable delivery; connection loss causes an exception which the application must handle.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Distributed System chapter 9 questions →