Skip to content
Merged
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 @@ -679,20 +679,24 @@ private void indexInvalidation(Collection<String> tokenIds, ActionListener<Token
}
}
}
if (retryTokenDocIds.isEmpty() == false) {
if (backoff.hasNext()) {
logger.debug("failed to invalidate [{}] tokens out of [{}], retrying to invalidate these too",
retryTokenDocIds.size(), tokenIds.size());
final TokensInvalidationResult incompleteResult = new TokensInvalidationResult(invalidated,
if (retryTokenDocIds.isEmpty() == false && backoff.hasNext()) {
logger.debug("failed to invalidate [{}] tokens out of [{}], retrying to invalidate these too",
retryTokenDocIds.size(), tokenIds.size());
final TokensInvalidationResult incompleteResult = new TokensInvalidationResult(invalidated,
previouslyInvalidated, failedRequestResponses);
final Runnable retryWithContextRunnable = client.threadPool().getThreadContext().preserveContext(
final Runnable retryWithContextRunnable = client.threadPool().getThreadContext().preserveContext(
() -> indexInvalidation(retryTokenDocIds, listener, backoff, srcPrefix, incompleteResult));
client.threadPool().schedule(retryWithContextRunnable, backoff.next(), GENERIC);
} else {
client.threadPool().schedule(retryWithContextRunnable, backoff.next(), GENERIC);
} else {
if (retryTokenDocIds.isEmpty() == false) {
logger.warn("failed to invalidate [{}] tokens out of [{}] after all retries", retryTokenDocIds.size(),
tokenIds.size());
for (String retryTokenDocId : retryTokenDocIds) {
failedRequestResponses.add(
new ElasticsearchException("Error invalidating [{}] with doc id [{}] after retries exhausted",
srcPrefix, retryTokenDocId));
}
}
} else {
final TokensInvalidationResult result = new TokensInvalidationResult(invalidated, previouslyInvalidated,
failedRequestResponses);
listener.onResponse(result);
Expand Down