elasticsearch icon indicating copy to clipboard operation
elasticsearch copied to clipboard

Utility method to read timeout parameter from REST requests

Open nicktindall opened this issue 9 months ago • 1 comments

Closes #108225

Consistent with #107986, this PR adds a utility for retrieving the timeout request parameter, defaulting it to AcknowledgedRequest#DEFAULT_ACK_TIMEOUT when it's not present. This represents a slight change in behaviour as instead of using the current ackTimeout value as a default we move to using the 30s constant. Though it appears that was the effective behaviour regardless, because all affected AcknowledgedRequests appear to set ackTimeout to DEFAULT_ACK_TIMEOUT value in the constructor.

Additionally, a method getTimeout was added, which will retrieve the timeout parameter but returning null when no such parameter is present. This is used mainly when creating descendants of BaseNodesRequest, and in a few other places where that was the existing behaviour.

nicktindall avatar May 15 '24 08:05 nicktindall

Pinging @elastic/es-distributed (Team:Distributed)

elasticsearchmachine avatar May 16 '24 04:05 elasticsearchmachine