]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15244 Despite sonar.log.useJsonOutput is enabled some logs are still not in...
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Tue, 10 Aug 2021 12:57:05 +0000 (07:57 -0500)
committersonartech <sonartech@sonarsource.com>
Wed, 11 Aug 2021 20:08:07 +0000 (20:08 +0000)
server/sonar-main/src/main/java/org/sonar/application/command/EsJvmOptions.java
server/sonar-main/src/test/java/org/sonar/application/command/CommandFactoryImplTest.java
server/sonar-main/src/test/java/org/sonar/application/command/EsJvmOptionsTest.java
sonar-application/build.gradle

index 94ff737543db3b741b0f8b631759f4e965cc0a66..9c96cc0e40726b16cfdd87a1d89d2bfa294152c7 100644 (file)
@@ -55,7 +55,6 @@ public class EsJvmOptions extends JvmOptions<EsJvmOptions> {
 
   private static void fromJvmDotOptionsFile(File tmpDir, Map<String, String> res) {
     // GC configuration
-    res.put("-XX:+UseConcMarkSweepGC", "");
     res.put("-XX:CMSInitiatingOccupancyFraction=", "75");
     res.put("-XX:+UseCMSInitiatingOccupancyOnly", "");
 
index ff12bbb68c6934cf11b6616e1b6fcc1484efcfb4..b3bf9a7c1ce5453b1542286d6331ae881d6af89a 100644 (file)
@@ -134,7 +134,7 @@ public class CommandFactoryImplTest {
     assertThat(esConfig.getHttpPort()).isEqualTo(9001);
     assertThat(esConfig.getEsJvmOptions().getAll())
       // enforced values
-      .contains("-XX:+UseConcMarkSweepGC", "-Dfile.encoding=UTF-8")
+      .contains("-Dfile.encoding=UTF-8")
       // default settings
       .contains("-Xms512m", "-Xmx512m", "-XX:+HeapDumpOnOutOfMemoryError");
     assertThat(esConfig.getEsYmlSettings()).isNotNull();
@@ -169,7 +169,7 @@ public class CommandFactoryImplTest {
     assertThat(esConfig.getHttpPort()).isEqualTo(9001);
     assertThat(esConfig.getEsJvmOptions().getAll())
       // enforced values
-      .contains("-XX:+UseConcMarkSweepGC", "-Dfile.encoding=UTF-8")
+      .contains("-Dfile.encoding=UTF-8")
       // default settings
       .contains("-Xms512m", "-Xmx512m", "-XX:+HeapDumpOnOutOfMemoryError");
     assertThat(esConfig.getEsYmlSettings()).isNotNull();
@@ -209,7 +209,7 @@ public class CommandFactoryImplTest {
     assertThat(esConfig.getHttpPort()).isEqualTo(1234);
     assertThat(esConfig.getEsJvmOptions().getAll())
       // enforced values
-      .contains("-XX:+UseConcMarkSweepGC", "-Dfile.encoding=UTF-8")
+      .contains("-Dfile.encoding=UTF-8")
       .contains("-Djava.io.tmpdir=" + tempDir.getAbsolutePath())
       // user settings
       .contains("-Xms10G", "-Xmx10G")
index 62086882fd4c6f87dcce061c9758270f9ccfddf5..f3d78b6adfe437fe4d7e8a449f7c0a0ab19ea6bd 100644 (file)
@@ -50,7 +50,6 @@ public class EsJvmOptionsTest {
 
     assertThat(underTest.getAll())
       .containsExactly(
-        "-XX:+UseConcMarkSweepGC",
         "-XX:CMSInitiatingOccupancyFraction=75",
         "-XX:+UseCMSInitiatingOccupancyOnly",
         "-Djava.io.tmpdir=" + tmpDir.getAbsolutePath(),
@@ -133,7 +132,6 @@ public class EsJvmOptionsTest {
         "\n" +
         "# DO NOT EDIT THIS FILE\n" +
         "\n" +
-        "-XX:+UseConcMarkSweepGC\n" +
         "-XX:CMSInitiatingOccupancyFraction=75\n" +
         "-XX:+UseCMSInitiatingOccupancyOnly\n" +
         "-Djava.io.tmpdir=" + tmpDir.getAbsolutePath() + "\n" +
index 4edfac543398b36b469a0a7f59e22f69012aee67..652f8febbbe59d336e5344973627ef025f8802a6 100644 (file)
@@ -108,6 +108,10 @@ task zip(type: Zip, dependsOn: [configurations.compile, downloadElasticSearch, v
       fcd.relativePath = new RelativePath(true, *path)
     }
     into("${archiveDir}/elasticsearch")
+    filesMatching('**/bin/elasticsearch-env') {
+      // to avoid warning logs
+      filter { line -> line.replaceAll('echo "warning: no-jdk distributions.*', ':') }
+    }
     // elasticsearch script will be replaced by patched version below
     exclude '**/bin/elasticsearch'
     exclude '**/bin/elasticsearch-cli'