Skip to content

Apache Lucene open-source search software

LUCENE-5671: upgrade ICU to fix concurrency bug

Robert Muir9afdfd503721
diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizer.java b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizer.java
index abcf09728d8..8cb0eeb3376 100644
--- a/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizer.java
+++ b/lucene/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizer.java
@@ -28,10 +28,10 @@ import org.apache.lucene.analysis.icu.tokenattributes.ScriptAttribute;
import com.ibm.icu.lang.UScript;
import java.io.IOException;
-import java.io.Reader;
import java.io.StringReader;
import java.util.Arrays;
import java.util.Random;
+import java.util.concurrent.CountDownLatch;
public class TestICUTokenizer extends BaseTokenStreamTestCase {
@@ -270,4 +270,43 @@ public class TestICUTokenizer extends BaseTokenStreamTestCase {
ts.end();
}
}
+
+ /** test for bugs like http://bugs.icu-project.org/trac/ticket/10767 */
+ public void testICUConcurrency() throws Exception {
+ int numThreads = 8;
+ final CountDownLatch startingGun = new CountDownLatch(1);
+ Thread threads[] = new Thread[numThreads];
+ for (int i = 0; i < threads.length; i++) {
+ threads[i] = new Thread() {
+ @Override
+ public void run() {
+ try {
+ startingGun.await();
+ long tokenCount = 0;
+ final String contents = "英 เบียร์ ビール ເບຍ abc";
+ for (int i = 0; i < 1000; i++) {
+ try (Tokenizer tokenizer = new ICUTokenizer()) {
+ tokenizer.setReader(new StringReader(contents));
+ tokenizer.reset();
+ while (tokenizer.incrementToken()) {
+ tokenCount++;
+ }
+ tokenizer.end();
+ }
+ }
+ if (VERBOSE) {
+ System.out.println(tokenCount);
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ threads[i].start();
+ }
+ startingGun.countDown();
+ for (int i = 0; i < threads.length; i++) {
+ threads[i].join();
+ }
+ }
}
diff --git a/lucene/ivy-versions.properties b/lucene/ivy-versions.properties
index 93bbee7e01d..9f31ffdc8f6 100644
--- a/lucene/ivy-versions.properties
+++ b/lucene/ivy-versions.properties
@@ -36,7 +36,7 @@ com.google.inject.guice.version = 3.0
/com.googlecode.concurrentlinkedhashmap/concurrentlinkedhashmap-lru = 1.2
/com.googlecode.juniversalchardet/juniversalchardet = 1.0.3
/com.googlecode.mp4parser/isoparser = 1.0-RC-1
-/com.ibm.icu/icu4j = 52.1
+/com.ibm.icu/icu4j = 53.1
/com.spatial4j/spatial4j = 0.4.1
com.sun.jersey.version = 1.8
diff --git a/lucene/licenses/icu4j-52.1.jar.sha1 b/lucene/licenses/icu4j-52.1.jar.sha1
deleted file mode 100644
index d3551e8380b..00000000000
--- a/lucene/licenses/icu4j-52.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-7dbc327670673acd14b487d120f05747d712c1c0
diff --git a/lucene/licenses/icu4j-53.1.jar.sha1 b/lucene/licenses/icu4j-53.1.jar.sha1
new file mode 100644
index 00000000000..ac60dac2311
--- /dev/null
+++ b/lucene/licenses/icu4j-53.1.jar.sha1
@@ -0,0 +1 @@
+786d9055d4ca8c1aab4a7d4ac8283f973fd7e41f
diff --git a/solr/licenses/icu4j-52.1.jar.sha1 b/solr/licenses/icu4j-52.1.jar.sha1
deleted file mode 100644
index d3551e8380b..00000000000
--- a/solr/licenses/icu4j-52.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-7dbc327670673acd14b487d120f05747d712c1c0
diff --git a/solr/licenses/icu4j-53.1.jar.sha1 b/solr/licenses/icu4j-53.1.jar.sha1
new file mode 100644
index 00000000000..ac60dac2311
--- /dev/null
+++ b/solr/licenses/icu4j-53.1.jar.sha1
@@ -0,0 +1 @@
+786d9055d4ca8c1aab4a7d4ac8283f973fd7e41f