-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix NPE in segment replicator #18997
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
Fix NPE in segment replicator #18997
Conversation
IndexStatsIT.testConcurrentIndexingAndStatsRequests sometimes fails with
the following NPE:
```
IndexStatsIT > testConcurrentIndexingAndStatsRequests {p0={"cluster.indices.replication.strategy":"SEGMENT"}} FAILED
java.lang.AssertionError:
Expected: an empty collection
but: <[[test][3] failed, reason [BroadcastShardOperationFailedException[operation indices:monitor/stats failed]; nested: NullPointerException[Cannot invoke "java.util.Map$Entry.getValue()" because "highestEntry" is null]; ]]>
at __randomizedtesting.SeedInfo.seed([B56C9D0503BD16AE:2FDF6CC817B0190]:0)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
at org.junit.Assert.assertThat(Assert.java:964)
at org.junit.Assert.assertThat(Assert.java:930)
at org.opensearch.indices.stats.IndexStatsIT.testConcurrentIndexingAndStatsRequests(IndexStatsIT.java:1451)
```
The `isEmpty()` check on the concurrent map is not sufficient because
entries can be removed after the check but before retrieving them.
Signed-off-by: Andrew Ross <[email protected]>
1c56866 to
e466967
Compare
|
❌ Gradle check result for e466967: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❕ Gradle check result for e466967: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18997 +/- ##
============================================
- Coverage 72.88% 72.81% -0.07%
+ Complexity 69327 69311 -16
============================================
Files 5643 5645 +2
Lines 318720 318788 +68
Branches 46113 46125 +12
============================================
- Hits 232294 232124 -170
- Misses 67595 67878 +283
+ Partials 18831 18786 -45 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
IndexStatsIT.testConcurrentIndexingAndStatsRequests sometimes fails with
the following NPE:
```
IndexStatsIT > testConcurrentIndexingAndStatsRequests {p0={"cluster.indices.replication.strategy":"SEGMENT"}} FAILED
java.lang.AssertionError:
Expected: an empty collection
but: <[[test][3] failed, reason [BroadcastShardOperationFailedException[operation indices:monitor/stats failed]; nested: NullPointerException[Cannot invoke "java.util.Map$Entry.getValue()" because "highestEntry" is null]; ]]>
at __randomizedtesting.SeedInfo.seed([B56C9D0503BD16AE:2FDF6CC817B0190]:0)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
at org.junit.Assert.assertThat(Assert.java:964)
at org.junit.Assert.assertThat(Assert.java:930)
at org.opensearch.indices.stats.IndexStatsIT.testConcurrentIndexingAndStatsRequests(IndexStatsIT.java:1451)
```
The `isEmpty()` check on the concurrent map is not sufficient because
entries can be removed after the check but before retrieving them.
Signed-off-by: Andrew Ross <[email protected]>
IndexStatsIT.testConcurrentIndexingAndStatsRequests sometimes fails with
the following NPE:
```
IndexStatsIT > testConcurrentIndexingAndStatsRequests {p0={"cluster.indices.replication.strategy":"SEGMENT"}} FAILED
java.lang.AssertionError:
Expected: an empty collection
but: <[[test][3] failed, reason [BroadcastShardOperationFailedException[operation indices:monitor/stats failed]; nested: NullPointerException[Cannot invoke "java.util.Map$Entry.getValue()" because "highestEntry" is null]; ]]>
at __randomizedtesting.SeedInfo.seed([B56C9D0503BD16AE:2FDF6CC817B0190]:0)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
at org.junit.Assert.assertThat(Assert.java:964)
at org.junit.Assert.assertThat(Assert.java:930)
at org.opensearch.indices.stats.IndexStatsIT.testConcurrentIndexingAndStatsRequests(IndexStatsIT.java:1451)
```
The `isEmpty()` check on the concurrent map is not sufficient because
entries can be removed after the check but before retrieving them.
Signed-off-by: Andrew Ross <[email protected]>
IndexStatsIT.testConcurrentIndexingAndStatsRequests sometimes fails with
the following NPE:
```
IndexStatsIT > testConcurrentIndexingAndStatsRequests {p0={"cluster.indices.replication.strategy":"SEGMENT"}} FAILED
java.lang.AssertionError:
Expected: an empty collection
but: <[[test][3] failed, reason [BroadcastShardOperationFailedException[operation indices:monitor/stats failed]; nested: NullPointerException[Cannot invoke "java.util.Map$Entry.getValue()" because "highestEntry" is null]; ]]>
at __randomizedtesting.SeedInfo.seed([B56C9D0503BD16AE:2FDF6CC817B0190]:0)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
at org.junit.Assert.assertThat(Assert.java:964)
at org.junit.Assert.assertThat(Assert.java:930)
at org.opensearch.indices.stats.IndexStatsIT.testConcurrentIndexingAndStatsRequests(IndexStatsIT.java:1451)
```
The `isEmpty()` check on the concurrent map is not sufficient because
entries can be removed after the check but before retrieving them.
Signed-off-by: Andrew Ross <[email protected]>
IndexStatsIT.testConcurrentIndexingAndStatsRequests sometimes fails with
the following NPE:
```
IndexStatsIT > testConcurrentIndexingAndStatsRequests {p0={"cluster.indices.replication.strategy":"SEGMENT"}} FAILED
java.lang.AssertionError:
Expected: an empty collection
but: <[[test][3] failed, reason [BroadcastShardOperationFailedException[operation indices:monitor/stats failed]; nested: NullPointerException[Cannot invoke "java.util.Map$Entry.getValue()" because "highestEntry" is null]; ]]>
at __randomizedtesting.SeedInfo.seed([B56C9D0503BD16AE:2FDF6CC817B0190]:0)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
at org.junit.Assert.assertThat(Assert.java:964)
at org.junit.Assert.assertThat(Assert.java:930)
at org.opensearch.indices.stats.IndexStatsIT.testConcurrentIndexingAndStatsRequests(IndexStatsIT.java:1451)
```
The `isEmpty()` check on the concurrent map is not sufficient because
entries can be removed after the check but before retrieving them.
Signed-off-by: Andrew Ross <[email protected]>
IndexStatsIT.testConcurrentIndexingAndStatsRequests sometimes fails with the following NPE:
The
isEmpty()check on the concurrent map is not sufficient because entries can be removed after the check but before retrieving them.This is one of the failures seen in #15836
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.