From f36ec12bf26ff54a5e7d7e30eebff2dd42a3479e Mon Sep 17 00:00:00 2001 From: Sebastian Utz Date: Fri, 4 Nov 2016 13:50:39 +0100 Subject: [PATCH] remove reduced stack size related to https://github.com/elastic/elasticsearch/issues/9135 also sync JAVA_OPTS with current ES opts --- CHANGES.txt | 3 +++ app/src/bin/crate.in.sh | 22 +++++++++++++++---- .../collectors/CompositeCollector.java | 3 +++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index b8ed2bb56ed0..485f47a54863 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,6 +5,9 @@ Changes for Crate Unreleased ========== + - Removed reduced thread stack size java option, stack size defaults + to JVM defaults now. + - Fix: selecting os_info['jvm']['vm_vendor'] and os_info['jvm']['name'] caused ColumnUnknownExceptions diff --git a/app/src/bin/crate.in.sh b/app/src/bin/crate.in.sh index f9b5d76f8c50..f4be5bfc8b18 100755 --- a/app/src/bin/crate.in.sh +++ b/app/src/bin/crate.in.sh @@ -38,9 +38,6 @@ if [ "x$CRATE_DIRECT_SIZE" != "x" ]; then JAVA_OPTS="$JAVA_OPTS -XX:MaxDirectMemorySize=${CRATE_DIRECT_SIZE}" fi -# reduce the per-thread stack size -JAVA_OPTS="$JAVA_OPTS -Xss256k" - # set to headless, just in case JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true" @@ -59,11 +56,28 @@ JAVA_OPTS="$JAVA_OPTS -XX:+UseCMSInitiatingOccupancyOnly" if [ "x$CRATE_USE_GC_LOGGING" != "x" ]; then JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCDetails" JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCTimeStamps" + JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCDateStamps" JAVA_OPTS="$JAVA_OPTS -XX:+PrintClassHistogram" JAVA_OPTS="$JAVA_OPTS -XX:+PrintTenuringDistribution" JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCApplicationStoppedTime" - JAVA_OPTS="$JAVA_OPTS -Xloggc:/var/log/crate/gc.log" + + GC_LOG_DIR="$CRATE_HOME/logs"; + JAVA_OPTS="$JAVA_OPTS -Xloggc:$GC_LOG_DIR/gc.log" + + # Ensure that the directory for the log file exists: the JVM will not create it. + if [[ ! -d "$GC_LOG_DIR" || ! -x "$GC_LOG_DIR" ]]; then + cat >&2 << EOF +Error: GC log directory '$GC_LOG_DIR' does not exist or is not accessible. +EOF + exit 1 + fi fi +# Disables explicit GC +JAVA_OPTS="$JAVA_OPTS -XX:+DisableExplicitGC" + # Ensure UTF-8 encoding by default (e.g. filenames) JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8" + +# Use our provided JNA always versus the system one +JAVA_OPTS="$JAVA_OPTS -Djna.nosys=true" \ No newline at end of file diff --git a/sql/src/main/java/io/crate/operation/collect/collectors/CompositeCollector.java b/sql/src/main/java/io/crate/operation/collect/collectors/CompositeCollector.java index 23f95a820c64..3bba0244c5e1 100644 --- a/sql/src/main/java/io/crate/operation/collect/collectors/CompositeCollector.java +++ b/sql/src/main/java/io/crate/operation/collect/collectors/CompositeCollector.java @@ -71,6 +71,9 @@ * (...) * CC-RR.finish() * all finished -> RR.finish + * + * Note: As this collector combines multiple collectors in 1 thread, due to current resume/repeat architecture, + * number of collectors (shards) is limited by the configured thread stack size (default: 1024k on 64bit). */ public class CompositeCollector implements CrateCollector {