Improve connection closing in RemoteClusterConnection#22804
Merged
s1monw merged 2 commits intoelastic:masterfrom Jan 26, 2017
Merged
Improve connection closing in RemoteClusterConnection#22804s1monw merged 2 commits intoelastic:masterfrom
RemoteClusterConnection#22804s1monw merged 2 commits intoelastic:masterfrom
Conversation
Some tests verify that all connection have been closed but due to the async / concurrent nature of `RemoteClusterConnection` there are situations where we notify listeners that trigger tests to finish before we actually closed all connections. The race is very very small and has no impact on the code correctness. This commit documents and improves the way we close connections to ensure test won't fail with false positives. Closes elastic#22803
javanna
reviewed
Jan 26, 2017
| // we have to close this connection before we notify listeners - this is mainly needed for test correctness | ||
| // since if we do it afterwards we might fail assertions that check if all high level connections are closed. | ||
| // from a code correctness perspective we could also close it afterwards. This try/with block will | ||
| // maintain the actual exceptions thrown from within the try block and suppress the ones that are possible thrown |
javanna
reviewed
Jan 26, 2017
| request.clear(); | ||
| request.nodes(true); | ||
| // here we pass on the connection since we can only close it once the sendRequest returns otherwise | ||
| // due to the async nature (it will return before it's actually send) this can cause the request to fail |
javanna
reviewed
Jan 26, 2017
| // since if we do it afterwards we might fail assertions that check if all high level connections are closed. | ||
| // from a code correctness perspective we could also close it afterwards. This try/with block will | ||
| // maintain the actual exceptions thrown from within the try block and suppress the ones that are possible thrown | ||
| // by closing hte connection |
s1monw
added a commit
that referenced
this pull request
Jan 26, 2017
Some tests verify that all connection have been closed but due to the async / concurrent nature of `RemoteClusterConnection` there are situations where we notify listeners that trigger tests to finish before we actually closed all connections. The race is very very small and has no impact on the code correctness. This commit documents and improves the way we close connections to ensure test won't fail with false positives. Closes #22803
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Jan 26, 2017
* master: (47 commits) Remove non needed import use expectThrows instead of manually testing exception Fix checkstyle and a test Update after review Read ec2 discovery address from aws instance tags Invalidate cached query results if query timed out (elastic#22807) Add remaining generated painless API Generate reference links for painless API (elastic#22775) [TEST] Fix ElasticsearchExceptionTests Add parsing method for ElasticsearchException.generateThrowableXContent() (elastic#22783) Improve connection closing in `RemoteClusterConnection` (elastic#22804) Docs: Cluster allocation explain should be on one page Remove DFS_QUERY_AND_FETCH as a search type (elastic#22787) Add repository-url module and move URLRepository (elastic#22752) fix date-processor to a new default year for every new pipeline execution. (elastic#22601) Add tests for top_hits aggregation (elastic#22754) [TEST] Added this for 93a28b0 submitted via elastic#22772 Fix typo in comment in OsProbe.java Add new ruby search library to community clients doc (elastic#22765) RangeQuery WITHIN case now normalises query (elastic#22431) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some tests verify that all connection have been closed but due to the
async / concurrent nature of
RemoteClusterConnectionthere are situationswhere we notify listeners that trigger tests to finish before we actually
closed all connections. The race is very very small and has no impact on the
code correctness. This commit documents and improves the way we close
connections to ensure test won't fail with false positives.
Closes #22803