Skip to content

Improve Stability of GCS Mock API#49592

Merged
original-brownbear merged 1 commit intoelastic:masterfrom
original-brownbear:stabilize-gcs-mock
Nov 26, 2019
Merged

Improve Stability of GCS Mock API#49592
original-brownbear merged 1 commit intoelastic:masterfrom
original-brownbear:stabilize-gcs-mock

Conversation

@original-brownbear
Copy link
Copy Markdown
Contributor

Same as #49518 pretty much but for GCS.
Fixing a few more spots where input stream can get closed
without being fully drained and adding assertions to make sure
it's always drained.
Moved the no-close stream wrapper to production code utilities since
there's a number of spots in production code where it's also useful
(will reuse it there in a follow-up).

Same as #49518 pretty much but for GCS.
Fixing a few more spots where input stream can get closed
without being fully drained and adding assertions to make sure
it's always drained.
Moved the no-close stream wrapper to production code utilities since
there's a number of spots in production code where it's also useful
(will reuse it there in a follow-up).
@original-brownbear original-brownbear added >test Issues or PRs that are addressing/adding tests :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.0.0 v7.6.0 v7.5.1 labels Nov 26, 2019
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore)

exchange.getResponseHeaders().add("Content-Type", "application/json");
exchange.sendResponseHeaders(RestStatus.OK.getStatus(), response.length);
exchange.getResponseBody().write(response);
while (exchange.getRequestBody().read(BUFFER) >= 0) ;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We were actually failing the assertion here since this request's body isn't empty.

@original-brownbear
Copy link
Copy Markdown
Contributor Author

@tlrx this cleans up all the unexpected EOF exceptions in the GCS tests I think. I ran tests in a loop with a breakpoint at sun.net.www.http.HttpClient#parseHTTPHeader (where all our failures kept coming from ... in Azure + GCS funny enough) and didn't break there anymore.

Copy link
Copy Markdown
Member

@tlrx tlrx left a comment

Choose a reason for hiding this comment

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

LGTM

@original-brownbear
Copy link
Copy Markdown
Contributor Author

Thanks Tanguy!

@original-brownbear original-brownbear merged commit 5f57c7e into elastic:master Nov 26, 2019
@original-brownbear original-brownbear deleted the stabilize-gcs-mock branch November 26, 2019 14:21
original-brownbear added a commit that referenced this pull request Nov 26, 2019
Same as #49518 pretty much but for GCS.
Fixing a few more spots where input stream can get closed
without being fully drained and adding assertions to make sure
it's always drained.
Moved the no-close stream wrapper to production code utilities since
there's a number of spots in production code where it's also useful
(will reuse it there in a follow-up).
original-brownbear added a commit that referenced this pull request Nov 26, 2019
Same as #49518 pretty much but for GCS.
Fixing a few more spots where input stream can get closed
without being fully drained and adding assertions to make sure
it's always drained.
Moved the no-close stream wrapper to production code utilities since
there's a number of spots in production code where it's also useful
(will reuse it there in a follow-up).
@original-brownbear original-brownbear restored the stabilize-gcs-mock branch August 6, 2020 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >test Issues or PRs that are addressing/adding tests v7.5.1 v7.6.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants