Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/bk-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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' }}
Expand Down Expand Up @@ -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' }}
Expand Down Expand Up @@ -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' }}
Expand Down Expand Up @@ -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' }}
Expand Down Expand Up @@ -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' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bk-streamstorage-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
jobs:
bot:
name: Bot tests
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

steps:
- name: clone repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dead-link-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/website-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/website-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ on:

jobs:
website-pull-validation:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 13 additions & 1 deletion native-io/src/main/native-io-jni/cpp/native_io_jni.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@
*/
#define _GNU_SOURCE

#include <jni.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h>
#endif

#include <org_apache_bookkeeper_common_util_nativeio_NativeIOJni.h>

Expand Down Expand Up @@ -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");
Expand Down
Loading