diff --git a/.github/workflows/bk-ci.yml b/.github/workflows/bk-ci.yml index 5348bc86ff4..a14437c5006 100644 --- a/.github/workflows/bk-ci.yml +++ b/.github/workflows/bk-ci.yml @@ -43,7 +43,7 @@ concurrency: jobs: build-and-license-check: name: PR Validation - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 60 steps: - name: Checkout @@ -98,7 +98,7 @@ jobs: unit-tests: name: ${{ matrix.step_name }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: ${{ matrix.timeout || 60 }} needs: [ 'build-and-license-check' ] if: ${{ needs.build-and-license-check.outputs.docs_only != 'true' }} @@ -206,7 +206,7 @@ jobs: integration-tests: name: Integration Tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 75 needs: [ 'build-and-license-check' ] if: ${{ needs.build-and-license-check.outputs.docs_only != 'true' }} @@ -298,7 +298,7 @@ jobs: backward-compatibility-tests: name: Backward compatibility tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 75 needs: [ 'build-and-license-check' ] if: ${{ needs.build-and-license-check.outputs.docs_only != 'true' }} @@ -449,7 +449,7 @@ jobs: jdk-compatibility-checks: name: ${{ matrix.step_name }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: ${{ matrix.timeout || 60 }} needs: [ 'build-and-license-check' ] if: ${{ needs.build-and-license-check.outputs.docs_only != 'true' }} @@ -496,7 +496,7 @@ jobs: owasp-dependency-check: name: OWASP Dependency Check - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 60 needs: [ 'build-and-license-check' ] if: ${{ needs.build-and-license-check.outputs.need_owasp == 'true' }} diff --git a/.github/workflows/bk-streamstorage-python.yml b/.github/workflows/bk-streamstorage-python.yml index 897c5cfdeab..d785c5cb716 100644 --- a/.github/workflows/bk-streamstorage-python.yml +++ b/.github/workflows/bk-streamstorage-python.yml @@ -39,7 +39,7 @@ on: jobs: stream-storage-python-client-unit-tests: name: StreamStorage Python Client Unit Tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 60 steps: - name: checkout @@ -52,7 +52,7 @@ jobs: Stream-storage-python-client-integration-tests: name: StreamStorage Python Client Integration Tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 60 steps: - name: checkout diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml index 26e1f973267..43d61c1179a 100644 --- a/.github/workflows/bot.yml +++ b/.github/workflows/bot.yml @@ -25,7 +25,7 @@ on: jobs: bot: name: Bot tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: clone repository diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index fa459876bd1..19b6393ee5d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,7 +29,7 @@ on: jobs: analyze: name: Analyze - runs-on: 'ubuntu-22.04' + runs-on: 'ubuntu-latest' timeout-minutes: 360 permissions: # required for all workflows diff --git a/.github/workflows/dead-link-checker.yaml b/.github/workflows/dead-link-checker.yaml index 1c87cab6746..944a5bf2032 100644 --- a/.github/workflows/dead-link-checker.yaml +++ b/.github/workflows/dead-link-checker.yaml @@ -33,7 +33,7 @@ concurrency: jobs: check-dead-links: name: Dead link checker - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 30 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/website-deploy.yaml b/.github/workflows/website-deploy.yaml index a31140362ed..868b1db0c7b 100644 --- a/.github/workflows/website-deploy.yaml +++ b/.github/workflows/website-deploy.yaml @@ -34,7 +34,7 @@ jobs: build-website: name: Build and deploy the website if: ${{ github.repository == 'apache/bookkeeper' }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 180 steps: - name: Checkout diff --git a/.github/workflows/website-pr-validation.yml b/.github/workflows/website-pr-validation.yml index fe7c40a504b..6b813f7c5e9 100644 --- a/.github/workflows/website-pr-validation.yml +++ b/.github/workflows/website-pr-validation.yml @@ -32,7 +32,7 @@ on: jobs: website-pull-validation: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 60 steps: - name: Checkout diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java index b163918b893..250fa0a016d 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java @@ -63,7 +63,6 @@ import java.io.IOException; import java.net.InetSocketAddress; import java.net.SocketAddress; -import java.net.UnknownHostException; import java.security.cert.Certificate; import java.util.ArrayDeque; import java.util.ArrayList; @@ -524,7 +523,7 @@ protected ChannelFuture connect() { try { addr = bookieAddressResolver.resolve(bookieId); } catch (BookieAddressResolver.BookieIdNotResolvedException err) { - LOG.error("Cannot connect to {} as endpoint resolution failed (probably bookie is down) err {}", + LOG.warn("Cannot connect to {} as endpoint resolution failed (probably bookie is down) err {}", bookieId, err.toString()); return processBookieNotResolvedError(startTime, err); } @@ -1783,16 +1782,8 @@ public void operationComplete(ChannelFuture future) { return; // pendingOps should have been completed when other channel connected } else { Throwable cause = future.cause(); - if (cause instanceof UnknownHostException || cause instanceof NativeIoException) { - // Don't log stack trace for common errors - logBookieUnavailable(() -> LOG.warn("Could not connect to bookie: {}/{}, current state {} : {}", - future.channel(), bookieId, state, future.cause().getMessage())); - } else { - // Regular exceptions, include stack trace - logBookieUnavailable(() -> LOG.error("Could not connect to bookie: {}/{}, current state {} : ", - future.channel(), bookieId, state, future.cause())); - } - + logBookieUnavailable(() -> LOG.warn("Could not connect to bookie: {}/{}, current state {} : {}", + future.channel(), bookieId, state, future.cause().getMessage())); rc = BKException.Code.BookieHandleNotAvailableException; Channel failedChannel = future.channel(); if (failedChannel != null) { // can be null in case of dummy failed ChannelFuture diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java index 05807455dc4..44636cb277d 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java @@ -738,7 +738,7 @@ private void deferLedgerLockReleaseOfFailedLedger(final long ledgerId) { long delayOfLedgerLockReleaseInMSecs = (numOfTimesFailedSoFar >= NUM_OF_EXPONENTIAL_BACKOFF_RETRIALS) ? this.lockReleaseOfFailedLedgerGracePeriod : this.baseBackoffForLockReleaseOfFailedLedger * (int) Math.pow(2, numOfTimesFailedSoFar); - LOG.error( + LOG.warn( "ReplicationWorker failed to replicate Ledger : {} for {} number of times, " + "so deferring the ledger lock release by {} msecs", ledgerId, numOfTimesFailedSoFar, delayOfLedgerLockReleaseInMSecs); diff --git a/native-io/src/main/native-io-jni/cpp/native_io_jni.c b/native-io/src/main/native-io-jni/cpp/native_io_jni.c index d3bc164bec9..7be468518b0 100644 --- a/native-io/src/main/native-io-jni/cpp/native_io_jni.c +++ b/native-io/src/main/native-io-jni/cpp/native_io_jni.c @@ -20,11 +20,16 @@ */ #define _GNU_SOURCE +#include #include #include #include #include +#ifdef _WIN32 +#include +#else #include +#endif #include @@ -165,7 +170,14 @@ JNIEXPORT jint JNICALL Java_org_apache_bookkeeper_common_util_nativeio_NativeIOJni_fsync(JNIEnv * env, jclass clazz, jint fd) { - int res = fsync(fd); + int res; + + // Guarantee compatibility for winsows. + #ifdef _WIN32 + res = _commit((int)fd); + #else + res = fsync((int)fd); + #endif if (res == -1) { throwExceptionWithErrno(env, "Failed to fsync");