Add HOLD message from sender to listener to handle immediate responses.
Previously, there was a window between the sender writing messages out to a socket, notifying the listener to expect a response with a given sequence ID, and the listener getting a response. Now, before sending, the sender notifies the listener to hold a response with a given <FD, sequence ID> pair until the sender finishes its send and transfers the result-handling callback to the listener. (In the case of timeouts, the sender sinks the error into the client library's callback, and the listener discards its HOLD record.) If the listener gets a full response before the second (EXPECT) message from the sender, it will be held and processed when the EXPECT message arrives. Also: . Added backpressure on the sender -> listener queue, because the sender is now sending two messages to the listener (HOLD and EXPECT) per outgoing request, and when the pool of messages used to relay between them is nearly full, there is a major performance hit. . The listener erroneously used a uint8_t for the ID instead of a uint16_t while building the freelist. Fix it, so the freelist does not end up with cycles when e.g. record 255's next is 0.
Loading
Please sign in to comment