From d73c63bfe78c40006b33fa9abe7d6c87ea81d0bf Mon Sep 17 00:00:00 2001 From: fengyubiao Date: Wed, 22 Oct 2025 12:53:14 +0800 Subject: [PATCH 1/2] [fix]compile error of the file native_io_jni.c for the env jdk11 & windows (#4665) Co-authored-by: fengyubiao (cherry picked from commit 5154149936e3f8187ae9e2755f43ea9c0ecb866e) (cherry picked from commit 4cfed9cd6b12571742339782aa59e6dfe1931e6b) --- .../src/main/native-io-jni/cpp/native_io_jni.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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"); From 0a238d88117aeca41c0173014e2db3a717d586e7 Mon Sep 17 00:00:00 2001 From: manas-ctds Date: Thu, 30 Oct 2025 17:25:54 +0530 Subject: [PATCH 2/2] Update github runner image to ubuntu-latest (cherry picked from commit 2e9d39044d1b9bb0688fd6463dbd63ba5d19f87a) --- .github/workflows/bk-ci.yml | 12 ++++++------ .github/workflows/bk-streamstorage-python.yml | 4 ++-- .github/workflows/bot.yml | 2 +- .github/workflows/codeql.yml | 2 +- .github/workflows/dead-link-checker.yaml | 2 +- .github/workflows/website-deploy.yaml | 2 +- .github/workflows/website-pr-validation.yml | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) 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