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/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");