Description
The spec currently has a notion of an RPC session. Within a session requests and responses need not be prefixed by handshakes.
The existing RPC implementations (python and Java) assume that all transports naturally have sessions, which is not the case. An HTTP transport may or may not have a session, a UDP transport does not naturally have a session. Moreover, we anticipate the implementation in Avro of a high-performance scalable transport that, e.g., permits multiplexing of requests and responses over a single TCP connection. Establishing a session in this context creates a race condition. Also, it would be advantageous if a single connection could service multiple protocols.
For the above reasons, I propose we remove the notion of RPC sessions. Each request and response payload must then be prefixed by a HandshakeRequest or HandshakeResponse respectively. In most cases this adds just 34 bytes to requests and 4 bytes to responses. The added runtime costs are negligible, as, instead of using a session key to access the cached protocol instead the protocol hashes are used.