Skip to content

Conversation

DaveCTurner
Copy link
Contributor

We set a 120s timeout on the repo analysis that runs in these tests, but
the REST client in use has a read timeout of 60s so any analysis that
lasts longer than that will yield an HTTP timeout that contains very
limited information to help further investigation. With this commit we
extend the HTTP timeout to be a few seconds longer than the analysis
timeout so we should get a proper response in these cases.

We set a 120s timeout on the repo analysis that runs in these tests, but
the REST client in use has a read timeout of 60s so any analysis that
lasts longer than that will yield an HTTP timeout that contains very
limited information to help further investigation. With this commit we
extend the HTTP timeout to be a few seconds longer than the analysis
timeout so we should get a proper response in these cases.
@DaveCTurner DaveCTurner added >test Issues or PRs that are addressing/adding tests :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs auto-backport Automatically create backport pull requests when merged v9.2.0 v9.1.1 v8.19.1 v9.0.5 v8.18.5 labels Jul 23, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Coordination Meta label for Distributed Coordination team label Jul 23, 2025
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@DiannaHohensee DiannaHohensee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

request.addParameter("seed", Long.toString(randomLong()));
request.setOptions(
RequestOptions.DEFAULT.toBuilder()
.setRequestConfig(RequestConfig.custom().setSocketTimeout(Math.toIntExact(timeout.millis() + 10_000)).build())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.setRequestConfig(RequestConfig.custom().setSocketTimeout(Math.toIntExact(timeout.millis() + 10_000)).build())
.setRequestConfig(RequestConfig.custom().setSocketTimeout(Math.toIntExact(timeout.seconds() + 10)).build())

You have seconds above and milliseconds here. We're probably more accustomed to thinking in milliseconds, so leaving it as-is is fine with me, too 🤷‍♀️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the parameter to setSocketTimeout is a raw integer representing the timeout in milliseconds - we could add ten seconds like this but then we'd have to convert it to millis either by multiplying by another magic number or else converting it back to a TimeValue and back again

@DaveCTurner DaveCTurner added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Jul 30, 2025
@elasticsearchmachine elasticsearchmachine merged commit 15faa70 into elastic:main Jul 30, 2025
33 checks passed
@DaveCTurner DaveCTurner deleted the 2025/07/23/repo-analysis-test-timeout branch July 30, 2025 13:05
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jul 30, 2025
We set a 120s timeout on the repo analysis that runs in these tests, but
the REST client in use has a read timeout of 60s so any analysis that
lasts longer than that will yield an HTTP timeout that contains very
limited information to help further investigation. With this commit we
extend the HTTP timeout to be a few seconds longer than the analysis
timeout so we should get a proper response in these cases.
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jul 30, 2025
We set a 120s timeout on the repo analysis that runs in these tests, but
the REST client in use has a read timeout of 60s so any analysis that
lasts longer than that will yield an HTTP timeout that contains very
limited information to help further investigation. With this commit we
extend the HTTP timeout to be a few seconds longer than the analysis
timeout so we should get a proper response in these cases.
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.1
8.19
9.0 Commit could not be cherrypicked due to conflicts
8.18 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 131744

DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jul 30, 2025
We set a 120s timeout on the repo analysis that runs in these tests, but
the REST client in use has a read timeout of 60s so any analysis that
lasts longer than that will yield an HTTP timeout that contains very
limited information to help further investigation. With this commit we
extend the HTTP timeout to be a few seconds longer than the analysis
timeout so we should get a proper response in these cases.

Backport of elastic#131744 to 9.0
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jul 30, 2025
We set a 120s timeout on the repo analysis that runs in these tests, but
the REST client in use has a read timeout of 60s so any analysis that
lasts longer than that will yield an HTTP timeout that contains very
limited information to help further investigation. With this commit we
extend the HTTP timeout to be a few seconds longer than the analysis
timeout so we should get a proper response in these cases.

Backport of elastic#131744 to 8.18
elasticsearchmachine pushed a commit that referenced this pull request Jul 30, 2025
We set a 120s timeout on the repo analysis that runs in these tests, but
the REST client in use has a read timeout of 60s so any analysis that
lasts longer than that will yield an HTTP timeout that contains very
limited information to help further investigation. With this commit we
extend the HTTP timeout to be a few seconds longer than the analysis
timeout so we should get a proper response in these cases.

Backport of #131744 to 8.18
elasticsearchmachine pushed a commit that referenced this pull request Jul 30, 2025
We set a 120s timeout on the repo analysis that runs in these tests, but
the REST client in use has a read timeout of 60s so any analysis that
lasts longer than that will yield an HTTP timeout that contains very
limited information to help further investigation. With this commit we
extend the HTTP timeout to be a few seconds longer than the analysis
timeout so we should get a proper response in these cases.

Backport of #131744 to 9.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Team:Distributed Coordination Meta label for Distributed Coordination team >test Issues or PRs that are addressing/adding tests v8.18.5 v8.19.1 v9.0.5 v9.1.1 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants