Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore closed exception on refresh pending location listener #55799

Merged
merged 1 commit into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3222,12 +3222,17 @@ private class RefreshPendingLocationListener implements ReferenceManager.Refresh

@Override
public void beforeRefresh() {
lastWriteLocation = getEngine().getTranslogLastWriteLocation();
try {
lastWriteLocation = getEngine().getTranslogLastWriteLocation();
} catch (AlreadyClosedException exc) {
// shard is closed - no location is fine
lastWriteLocation = null;
}
}

@Override
public void afterRefresh(boolean didRefresh) {
if (didRefresh) {
if (didRefresh && lastWriteLocation != null) {
pendingRefreshLocation.updateAndGet(pendingLocation -> {
if (pendingLocation == null || pendingLocation.compareTo(lastWriteLocation) <= 0) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ public void testTermsAggregation() throws Exception {
}
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/55792")
public void testRestartAfterCompletion() throws Exception {
final AsyncSearchResponse initial;
try (SearchResponseIterator it =
Expand Down Expand Up @@ -208,7 +207,6 @@ public void testDeleteCleanupIndex() throws Exception {
ensureTaskRemoval(response.getId());
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/55792")
public void testCleanupOnFailure() throws Exception {
final AsyncSearchResponse initial;
try (SearchResponseIterator it =
Expand Down