You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/09/03 11:24:39 UTC

[GitHub] [lucene-solr] uschindler opened a new pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

uschindler opened a new pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824


   A factory method allows to return a different instance depending on Java version (for now everything after Java 11 is disallowed).
   
   We can improve this when we exactly know which versions are affected. Once the bug is fixed and Lucene uses a later minimum version, we can easily remove the class.
   
   TODO: We should add a forbiddenapis to disallow direct use of deflater by disallowing its constructor.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] jpountz commented on a change in pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

Posted by GitBox <gi...@apache.org>.
jpountz commented on a change in pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824#discussion_r482963038



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene87/BugfixDeflater_JDK8252739.java
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.codecs.lucene87;
+
+import java.util.Arrays;
+import java.util.zip.DataFormatException;
+import java.util.zip.Deflater;
+import java.util.zip.Inflater;
+
+/**
+ * This class is a workaround for JDK bug
+ * <a href="https://bugs.openjdk.java.net/browse/JDK-8252739">JDK-8252739</a>.
+ */
+final class BugfixDeflater_JDK8252739 extends Deflater {
+  
+  private final byte[] dictBytesScratch;
+
+  private BugfixDeflater_JDK8252739(int level, boolean nowrap, int dictLength) {
+    super(level, nowrap);
+    this.dictBytesScratch = new byte[dictLength];
+  }
+  
+  @Override
+  public void setDictionary(byte[] dictBytes, int off, int len) {
+    if (off > 0) {
+      System.arraycopy(dictBytes, off, dictBytesScratch, 0, len);
+      super.setDictionary(dictBytesScratch, 0, len);
+    } else {
+      super.setDictionary(dictBytes, off, len);
+    }
+  }
+
+  public static Deflater createDeflaterInstance(int level, boolean nowrap, int dictLength) {
+    if (dictLength < 0) {
+      throw new IllegalArgumentException("dictLength must be >= 0");
+    }
+    if (IS_BUGGY_JDK) {
+      return new BugfixDeflater_JDK8252739(level, nowrap, dictLength);
+    } else {
+      return new Deflater(level, nowrap);
+    }
+  }
+  
+  private static boolean detectBuggyJDK() {
+    final byte[] testData = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };
+    final byte[] compressed = new byte[32]; // way enough space
+    final Deflater deflater = new Deflater(6, true);
+    try {
+      deflater.reset();
+      deflater.setDictionary(testData, 4, 4);
+      deflater.setInput(testData);
+      deflater.finish();
+      deflater.deflate(compressed, 0, compressed.length, Deflater.FULL_FLUSH);
+    } finally {
+      deflater.end();
+    }
+    
+    final Inflater inflater = new Inflater(true);
+    final byte[] restored = new byte[testData.length];
+    try {
+      inflater.reset();
+      inflater.setDictionary(testData, 4, 4);
+      inflater.setInput(compressed);
+      final int restoredLength = inflater.inflate(restored);
+      if (restoredLength != testData.length) {
+        return true;
+      }
+    } catch (DataFormatException e) {
+      return true;
+    } finally {
+      inflater.end();
+    }
+
+    if (Arrays.equals(testData, restored) == false) {
+      return true;
+    }
+    
+    // all fine
+    return false;
+  }

Review comment:
       likewise, nevermind




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824#discussion_r482923181



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene87/DeflateWithPresetDictCompressionMode.java
##########
@@ -155,16 +155,15 @@ public Decompressor clone() {
 
   private static class DeflateWithPresetDictCompressor extends Compressor {
 
-    final byte[] dictBytes;
-    final int blockLength;
+    private final int dictLength, blockLength;
     final Deflater compressor;
     byte[] compressed;
     boolean closed;
 
     DeflateWithPresetDictCompressor(int level, int dictLength, int blockLength) {
-      compressor = new Deflater(level, true);

Review comment:
       that's also my idea! I am working on probing at the moment. like 128 bytes of dict and 128 bytes of data. If result is correct the factory method i implemented uses the plain Deflater instead of the workaround class.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler merged pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

Posted by GitBox <gi...@apache.org>.
uschindler merged pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824#discussion_r482952318



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene87/DeflateWithPresetDictCompressionMode.java
##########
@@ -155,16 +155,15 @@ public Decompressor clone() {
 
   private static class DeflateWithPresetDictCompressor extends Compressor {
 
-    final byte[] dictBytes;
-    final int blockLength;
+    private final int dictLength, blockLength;
     final Deflater compressor;
     byte[] compressed;
     boolean closed;
 
     DeflateWithPresetDictCompressor(int level, int dictLength, int blockLength) {
-      compressor = new Deflater(level, true);

Review comment:
       I added detection in latest commit. Works with 8 bytes :-)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on a change in pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824#discussion_r482923181



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene87/DeflateWithPresetDictCompressionMode.java
##########
@@ -155,16 +155,15 @@ public Decompressor clone() {
 
   private static class DeflateWithPresetDictCompressor extends Compressor {
 
-    final byte[] dictBytes;
-    final int blockLength;
+    private final int dictLength, blockLength;
     final Deflater compressor;
     byte[] compressed;
     boolean closed;
 
     DeflateWithPresetDictCompressor(int level, int dictLength, int blockLength) {
-      compressor = new Deflater(level, true);

Review comment:
       that's also my idea! I am working on probing at the moment. like 128 bytes of dict and 128 bytes of data. If result is correct the factory method i implemented uses the plain Deflater.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] jpountz commented on a change in pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

Posted by GitBox <gi...@apache.org>.
jpountz commented on a change in pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824#discussion_r482960153



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene87/BugfixDeflater_JDK8252739.java
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.codecs.lucene87;
+
+import java.util.Arrays;
+import java.util.zip.DataFormatException;
+import java.util.zip.Deflater;
+import java.util.zip.Inflater;
+
+/**
+ * This class is a workaround for JDK bug
+ * <a href="https://bugs.openjdk.java.net/browse/JDK-8252739">JDK-8252739</a>.
+ */
+final class BugfixDeflater_JDK8252739 extends Deflater {
+  
+  private final byte[] dictBytesScratch;
+
+  private BugfixDeflater_JDK8252739(int level, boolean nowrap, int dictLength) {
+    super(level, nowrap);
+    this.dictBytesScratch = new byte[dictLength];
+  }
+  
+  @Override
+  public void setDictionary(byte[] dictBytes, int off, int len) {
+    if (off > 0) {
+      System.arraycopy(dictBytes, off, dictBytesScratch, 0, len);
+      super.setDictionary(dictBytesScratch, 0, len);
+    } else {
+      super.setDictionary(dictBytes, off, len);
+    }
+  }
+
+  public static Deflater createDeflaterInstance(int level, boolean nowrap, int dictLength) {
+    if (dictLength < 0) {
+      throw new IllegalArgumentException("dictLength must be >= 0");
+    }
+    if (IS_BUGGY_JDK) {
+      return new BugfixDeflater_JDK8252739(level, nowrap, dictLength);
+    } else {
+      return new Deflater(level, nowrap);
+    }
+  }
+  
+  private static boolean detectBuggyJDK() {
+    final byte[] testData = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };
+    final byte[] compressed = new byte[32]; // way enough space
+    final Deflater deflater = new Deflater(6, true);
+    try {
+      deflater.reset();
+      deflater.setDictionary(testData, 4, 4);
+      deflater.setInput(testData);
+      deflater.finish();
+      deflater.deflate(compressed, 0, compressed.length, Deflater.FULL_FLUSH);
+    } finally {
+      deflater.end();
+    }
+    
+    final Inflater inflater = new Inflater(true);
+    final byte[] restored = new byte[testData.length];
+    try {
+      inflater.reset();
+      inflater.setDictionary(testData, 4, 4);
+      inflater.setInput(compressed);
+      final int restoredLength = inflater.inflate(restored);
+      if (restoredLength != testData.length) {
+        return true;
+      }
+    } catch (DataFormatException e) {
+      return true;
+    } finally {
+      inflater.end();
+    }
+
+    if (Arrays.equals(testData, restored) == false) {
+      return true;
+    }
+    
+    // all fine
+    return false;
+  }
+  
+  public static final boolean IS_BUGGY_JDK = detectBuggyJDK();
+  
+  static {
+    System.err.println("JDK is buggy: " + IS_BUGGY_JDK);

Review comment:
       Did you only mean to use this for debugging?

##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene87/BugfixDeflater_JDK8252739.java
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.codecs.lucene87;
+
+import java.util.Arrays;
+import java.util.zip.DataFormatException;
+import java.util.zip.Deflater;
+import java.util.zip.Inflater;
+
+/**
+ * This class is a workaround for JDK bug
+ * <a href="https://bugs.openjdk.java.net/browse/JDK-8252739">JDK-8252739</a>.
+ */
+final class BugfixDeflater_JDK8252739 extends Deflater {
+  
+  private final byte[] dictBytesScratch;
+
+  private BugfixDeflater_JDK8252739(int level, boolean nowrap, int dictLength) {
+    super(level, nowrap);
+    this.dictBytesScratch = new byte[dictLength];
+  }
+  
+  @Override
+  public void setDictionary(byte[] dictBytes, int off, int len) {
+    if (off > 0) {
+      System.arraycopy(dictBytes, off, dictBytesScratch, 0, len);
+      super.setDictionary(dictBytesScratch, 0, len);
+    } else {
+      super.setDictionary(dictBytes, off, len);
+    }
+  }
+
+  public static Deflater createDeflaterInstance(int level, boolean nowrap, int dictLength) {
+    if (dictLength < 0) {
+      throw new IllegalArgumentException("dictLength must be >= 0");
+    }
+    if (IS_BUGGY_JDK) {
+      return new BugfixDeflater_JDK8252739(level, nowrap, dictLength);
+    } else {
+      return new Deflater(level, nowrap);
+    }
+  }
+  
+  private static boolean detectBuggyJDK() {
+    final byte[] testData = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };
+    final byte[] compressed = new byte[32]; // way enough space
+    final Deflater deflater = new Deflater(6, true);
+    try {
+      deflater.reset();
+      deflater.setDictionary(testData, 4, 4);
+      deflater.setInput(testData);
+      deflater.finish();
+      deflater.deflate(compressed, 0, compressed.length, Deflater.FULL_FLUSH);
+    } finally {
+      deflater.end();
+    }
+    
+    final Inflater inflater = new Inflater(true);
+    final byte[] restored = new byte[testData.length];
+    try {
+      inflater.reset();
+      inflater.setDictionary(testData, 4, 4);
+      inflater.setInput(compressed);
+      final int restoredLength = inflater.inflate(restored);
+      if (restoredLength != testData.length) {
+        return true;
+      }
+    } catch (DataFormatException e) {
+      return true;
+    } finally {
+      inflater.end();
+    }
+
+    if (Arrays.equals(testData, restored) == false) {
+      return true;
+    }
+    
+    // all fine
+    return false;
+  }

Review comment:
       If you confirmed that this fails on at least one buggy JVM, this detection code LGTM.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824#discussion_r482922248



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene87/DeflateWithPresetDictCompressionMode.java
##########
@@ -155,16 +155,15 @@ public Decompressor clone() {
 
   private static class DeflateWithPresetDictCompressor extends Compressor {
 
-    final byte[] dictBytes;
-    final int blockLength;
+    private final int dictLength, blockLength;
     final Deflater compressor;
     byte[] compressed;
     boolean closed;
 
     DeflateWithPresetDictCompressor(int level, int dictLength, int blockLength) {
-      compressor = new Deflater(level, true);

Review comment:
       Just a thought, really.
   
   If it's a bug that can be probed for (and it can be - see Adrian's repro) then it could as well be a static initialization of a supplier of Deflater instances; if we probe for a buggy JVM, we return the wrapper. If we don't we return the Deflater. This way on non-affected JVMs nothing happens and if we do use the wrapper, we know the JVM is broken.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] jpountz commented on a change in pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

Posted by GitBox <gi...@apache.org>.
jpountz commented on a change in pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824#discussion_r482962830



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene87/BugfixDeflater_JDK8252739.java
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.codecs.lucene87;
+
+import java.util.Arrays;
+import java.util.zip.DataFormatException;
+import java.util.zip.Deflater;
+import java.util.zip.Inflater;
+
+/**
+ * This class is a workaround for JDK bug
+ * <a href="https://bugs.openjdk.java.net/browse/JDK-8252739">JDK-8252739</a>.
+ */
+final class BugfixDeflater_JDK8252739 extends Deflater {
+  
+  private final byte[] dictBytesScratch;
+
+  private BugfixDeflater_JDK8252739(int level, boolean nowrap, int dictLength) {
+    super(level, nowrap);
+    this.dictBytesScratch = new byte[dictLength];
+  }
+  
+  @Override
+  public void setDictionary(byte[] dictBytes, int off, int len) {
+    if (off > 0) {
+      System.arraycopy(dictBytes, off, dictBytesScratch, 0, len);
+      super.setDictionary(dictBytesScratch, 0, len);
+    } else {
+      super.setDictionary(dictBytes, off, len);
+    }
+  }
+
+  public static Deflater createDeflaterInstance(int level, boolean nowrap, int dictLength) {
+    if (dictLength < 0) {
+      throw new IllegalArgumentException("dictLength must be >= 0");
+    }
+    if (IS_BUGGY_JDK) {
+      return new BugfixDeflater_JDK8252739(level, nowrap, dictLength);
+    } else {
+      return new Deflater(level, nowrap);
+    }
+  }
+  
+  private static boolean detectBuggyJDK() {
+    final byte[] testData = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };
+    final byte[] compressed = new byte[32]; // way enough space
+    final Deflater deflater = new Deflater(6, true);
+    try {
+      deflater.reset();
+      deflater.setDictionary(testData, 4, 4);
+      deflater.setInput(testData);
+      deflater.finish();
+      deflater.deflate(compressed, 0, compressed.length, Deflater.FULL_FLUSH);
+    } finally {
+      deflater.end();
+    }
+    
+    final Inflater inflater = new Inflater(true);
+    final byte[] restored = new byte[testData.length];
+    try {
+      inflater.reset();
+      inflater.setDictionary(testData, 4, 4);
+      inflater.setInput(compressed);
+      final int restoredLength = inflater.inflate(restored);
+      if (restoredLength != testData.length) {
+        return true;
+      }
+    } catch (DataFormatException e) {
+      return true;
+    } finally {
+      inflater.end();
+    }
+
+    if (Arrays.equals(testData, restored) == false) {
+      return true;
+    }
+    
+    // all fine
+    return false;
+  }
+  
+  public static final boolean IS_BUGGY_JDK = detectBuggyJDK();
+  
+  static {
+    System.err.println("JDK is buggy: " + IS_BUGGY_JDK);

Review comment:
       oops nevermind I just read your other comment




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824#issuecomment-686556365


   Short info: After backporting to 8.x, of course JDK 8u192 was detected as **non-buggy**.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824#issuecomment-686471292


   I converted this to a draf, because checks failed with precommit. But this should stay in for doing quick checks by @jpountz like commented before!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824#issuecomment-686427056


   This effectively  reverts @jpountz's hotfix commit, but as he moved classes around in the meantime, I had to do it manually.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824#issuecomment-686468187


   Hi, I added detectction in my latest commit:
   
   ```
   C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr1>java -version
   openjdk version "11.0.2" 2019-01-15
   OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
   OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
   
   C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr1>gradlew -Ptests.verbose=true :lucene:core:test --tests TestLucene87StoredFieldsFormatHighCompression | grep buggy
     2> JDK is buggy: false
   
   ```
   
   vs.
   
   ```
   C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr1>java -version
   openjdk version "13" 2019-09-17
   OpenJDK Runtime Environment (build 13+33)
   OpenJDK 64-Bit Server VM (build 13+33, mixed mode, sharing)
   
   C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr1>gradlew -Ptests.verbose=true :lucene:core:test --tests TestLucene87StoredFieldsFormatHighCompression | grep buggy
     2> JDK is buggy: true
   ```
   
   The `System.err.println()` needs of course be removed before merge :-)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] uschindler commented on pull request #1824: LUCENE-9500: Separate the Deflater hack from the Lucene code to a subclass of java.util.zip.Deflater

Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #1824:
URL: https://github.com/apache/lucene-solr/pull/1824#issuecomment-686528216


   Hi,
   I did further tests (except Java 8, I need to merge first), Results looking fine:
   - OpenJDK JDK 11.0.2 reports **non-buggy**
   - AdoptJDK 11.0.5 reports **buggy**
   - Oracle JDK 11.0.8 reports **buggy**
   - JDK 12 reports **non-buggy**
   - JDK 13 reports **buggy**
   - JDK 14 reports **buggy**
   
   I keep the class for now as package private. Thoughts:
   - If Elasticsearch or Solr want to report on startup that the JDK they are using is buggy and they should upgrade (once they have a fix available, a fix for JDK 11 looks promising as this was a regression!), we can make the class public, so startup code has access to the boolean flag
   - We may print a Info in the test, so when running tests you get informed about the issue (useful for quick testing a new JDK release)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org