diff --git a/.github/workflows/bk-ci.yml b/.github/workflows/bk-ci.yml index c38a2680ac1..a373830a81f 100644 --- a/.github/workflows/bk-ci.yml +++ b/.github/workflows/bk-ci.yml @@ -79,9 +79,16 @@ jobs: distribution: 'temurin' java-version: 11 + - name: Set up Maven + uses: apache/pulsar-test-infra/setup-maven@master + with: + maven-version: 3.8.7 + - name: Validate pull request if: steps.check_changes.outputs.docs_only != 'true' - run: mvn clean -T 1C -B -nsu apache-rat:check checkstyle:check spotbugs:check package -Ddistributedlog -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO + run: | + mvn -T 1C -B -nsu clean install -Ddistributedlog -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO + mvn -T 1C -B -nsu apache-rat:check checkstyle:check spotbugs:check package -Ddistributedlog -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO - name: Check license files if: steps.check_changes.outputs.docs_only != 'true' @@ -152,6 +159,11 @@ jobs: distribution: 'temurin' java-version: 11 + - name: Set up Maven + uses: apache/pulsar-test-infra/setup-maven@master + with: + maven-version: 3.8.7 + - name: Build run: | projects_list= @@ -194,6 +206,10 @@ jobs: path: surefire-reports retention-days: 7 + - name: Setup tmate session + if: failure() + uses: mxschmitt/action-tmate@v3 + integration-tests: name: Integration Tests runs-on: ubuntu-latest @@ -223,6 +239,11 @@ jobs: distribution: 'temurin' java-version: 11 + - name: Set up Maven + uses: apache/pulsar-test-infra/setup-maven@master + with: + maven-version: 3.8.7 + - name: Build with Maven run: mvn -B -nsu clean install -Pdocker -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO @@ -265,6 +286,11 @@ jobs: distribution: 'temurin' java-version: 8 + - name: Set up Maven + uses: apache/pulsar-test-infra/setup-maven@master + with: + maven-version: 3.8.7 + - name: Build with Maven run: mvn -B -nsu clean install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO @@ -311,6 +337,11 @@ jobs: distribution: 'temurin' java-version: 11 + - name: Set up Maven + uses: apache/pulsar-test-infra/setup-maven@master + with: + maven-version: 3.8.7 + - name: mvn package run: mvn -B -nsu clean package -DskipTests @@ -343,6 +374,11 @@ jobs: distribution: 'temurin' java-version: 11 + - name: Set up Maven + uses: apache/pulsar-test-infra/setup-maven@master + with: + maven-version: 3.8.7 + - name: mvn package run: mvn -B -nsu clean package -DskipTests @@ -387,6 +423,11 @@ jobs: distribution: 'temurin' java-version: ${{ matrix.jdk_version }} + - name: Set up Maven + uses: apache/pulsar-test-infra/setup-maven@master + with: + maven-version: 3.8.7 + - name: Build with Maven run: mvn clean package -B -nsu -DskipBookKeeperServerTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO @@ -422,6 +463,11 @@ jobs: with: java-version: 11 + - name: Set up Maven + uses: apache/pulsar-test-infra/setup-maven@master + with: + maven-version: 3.8.7 + - name: run "clean install verify" to trigger dependency check # excluding dlfs because it includes hadoop lib with # CVEs that we cannot patch up anyways diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/PendingAddOp.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/PendingAddOp.java index 05f740d33a3..394c961cbc9 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/PendingAddOp.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/PendingAddOp.java @@ -23,6 +23,7 @@ import static org.apache.bookkeeper.proto.BookieProtocol.FLAG_RECOVERY_ADD; import com.google.common.collect.ImmutableMap; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.netty.buffer.ByteBuf; import io.netty.util.Recycler; import io.netty.util.Recycler.Handle; @@ -80,6 +81,7 @@ class PendingAddOp implements WriteCallback { boolean allowFailFast = false; List ensemble; + @SuppressFBWarnings("IS2_INCONSISTENT_SYNC") static PendingAddOp create(LedgerHandle lh, ClientContext clientCtx, List ensemble, ByteBuf payload, EnumSet writeFlags, diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/PageCacheUtil.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/PageCacheUtil.java index 5dc1a5d8cce..08bf9cfb385 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/PageCacheUtil.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/PageCacheUtil.java @@ -95,7 +95,7 @@ public static void bestEffortRemoveFromPageCache(int fd, long offset, long len) } try { NATIVE_IO.posix_fadvise(fd, offset, len, POSIX_FADV_DONTNEED); - } catch (Exception e) { + } catch (Throwable e) { log.warn("Failed to perform posix_fadvise: {}", e.getMessage()); fadvisePossible = false; } diff --git a/buildtools/src/main/resources/bookkeeper/findbugsExclude.xml b/buildtools/src/main/resources/bookkeeper/findbugsExclude.xml index 09daf196569..dec4118b58a 100644 --- a/buildtools/src/main/resources/bookkeeper/findbugsExclude.xml +++ b/buildtools/src/main/resources/bookkeeper/findbugsExclude.xml @@ -317,6 +317,11 @@ + + + + + diff --git a/microbenchmarks/src/main/java/org/apache/bookkeeper/bookie/GroupSortBenchmark.java b/microbenchmarks/src/main/java/org/apache/bookkeeper/bookie/GroupSortBenchmark.java index 8df5691ae70..b51fc758b6d 100644 --- a/microbenchmarks/src/main/java/org/apache/bookkeeper/bookie/GroupSortBenchmark.java +++ b/microbenchmarks/src/main/java/org/apache/bookkeeper/bookie/GroupSortBenchmark.java @@ -23,6 +23,7 @@ import java.util.Arrays; import java.util.Random; +import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; import org.apache.bookkeeper.bookie.storage.ldb.ArrayGroupSort; import org.openjdk.jmh.annotations.Benchmark; @@ -55,7 +56,7 @@ public static class TestState { private long[] items; public TestState() { - Random r = new Random(); + Random r = ThreadLocalRandom.current(); for (int i = 0; i < (N * 4); i++) { randomItems[i] = r.nextLong(); } diff --git a/pom.xml b/pom.xml index 43e1217e9ff..37870611fa4 100644 --- a/pom.xml +++ b/pom.xml @@ -205,7 +205,7 @@ 1.4.1.Final 0.6.1 9.3 - 4.6.0.0 + 4.7.3.2 1 4.0.0 3.0.1 @@ -1118,7 +1118,7 @@ ${maven-surefire-plugin.version} - @{argLine} -Xmx2G -Djava.net.preferIPv4Stack=true -Dio.netty.leakDetection.level=paranoid + -Xmx2G -Djava.net.preferIPv4Stack=true -Dio.netty.leakDetection.level=paranoid ${test.additional.args} ${redirectTestOutputToFile} ${forkCount.variable} false