Open mpfz0r opened 5 years ago
Some context:
This happens because the SetIndexReadOnlyAndCalculateRangeJob starts with a delay of 30 seconds after the index has been rotated. (a workaround for an indexing issue)
If the index gets deleted shortly after index rotation, the SetIndexReadOnlyAndCalculateRangeJob
fails because the index is already gone and we cannot check if it's closed.
One possible solution is to check if the index exists before we check if it's closed in Indices#isClosed
.
This still leaves a window for a race condition of course. Another solution would be to use the regular API instead of the _cat
API to do the closed check and handle errors properly. The _cat
API error handling in the Jest ES client doesn't allow us to generate a good error here.
A quickly consecutive execution of rotating the active write index and deleting the old index triggers this exception:
Steps to Reproduce (for bugs)