-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Rare failure from org.elasticsearch.gateway.PersistedClusterStateServiceTests.testHandlesShuffledDocuments #88471
Comments
Pinging @elastic/es-core-infra (Team:Core/Infra) |
The PersistedClusterStateService test that fails is expecting a CorruptStateException, but it actually gets an IndexOutOfBoundsException. Here's why: If the Here's a little bit of WIP that could maybe help in the way towards a solution: diff --git a/server/src/main/java/org/elasticsearch/common/compress/DeflateCompressor.java b/server/src/main/java/org/elasticsearch/common/compress/DeflateCompressor.java
index e8c9fb69e6c..daecf286b20 100644
--- a/server/src/main/java/org/elasticsearch/common/compress/DeflateCompressor.java
+++ b/server/src/main/java/org/elasticsearch/common/compress/DeflateCompressor.java
@@ -201,6 +203,17 @@ public class DeflateCompressor implements Compressor {
@Override
public BytesReference uncompress(BytesReference bytesReference) throws IOException {
+ if (bytesReference.length() < HEADER.length) {
+ throw new IOException(
+ String.format(
+ Locale.ROOT,
+ "bytesReference length [%s] is less than HEADER length [%s]",
+ bytesReference.length(),
+ HEADER.length
+ )
+ );
+ }
+
final BytesStreamOutput buffer = baos.get();
try {
final Inflater inflater = inflaterRef.get(); |
Related to #88479, in that I ran into this while testing that PR locally. |
This commit checks for an edge case in decompression with deflate where the input is shorter than the deflate header size. Before this commit a slice error would occur with a negative bound. With this commit an IOException is thrown. closes elastic#88471
This commit checks for an edge case in decompression with deflate where the input is shorter than the deflate header size. Before this commit a slice error would occur with a negative bound. With this commit an IOException is thrown. closes #88471
CI Link
https://gradle-enterprise.elastic.co/s/tolzhhuvjvobo/tests/:server:test/org.elasticsearch.gateway.PersistedClusterStateServiceTests/testHandlesShuffledDocuments%20%7Bseed=%5B6281127015198EC1:C2E270963902654%5D%7D?top-execution=1
Repro line
./gradlew ':server:test' --tests "org.elasticsearch.gateway.PersistedClusterStateServiceTests.testHandlesShuffledDocuments {seed=[6281127015198EC1:C2E270963902654]}" -Dtests.seed=6281127015198EC1 -Dtests.locale=ca -Dtests.timezone=Africa/Asmera -Druntime.java=18
Does it reproduce?
No
Applicable branches
master, maybe others
Failure history
No response
Failure excerpt
I haven't been able to get a reliable reproduction line, but usually running the test 10,000 times seems to provoke it:
The text was updated successfully, but these errors were encountered: