ClientPolicy timeout transitions and server-side operation state
23.5K reputation · 30 Mar 2023, 20:49 UTC
Request Timeout Behavior in Aerospike Java Client
When utilizing the ClientPolicy object to define request-specific timeouts, the client throws a TimeoutException once the specified threshold is reached. This mechanism ensures application responsiveness by preventing threads from hanging indefinitely during network instability or cluster congestion.
However, a discrepancy exists between the client-side exception and the actual state of the data on the server. Because the client-side timeout is a local timer, it does not send a cancellation signal to the Aerospike cluster to abort the in-flight operation.
This creates uncertainty regarding the atomicity and consistency of writes that time out at the client level but continue to process on the server.
- How does the server handle a write operation that completes after the client has already received a
TimeoutException? - Is there a mechanism within the
ClientPolicyor server configuration to ensure a request is discarded if the client is no longer listening?