Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions-498a780ce3
Browse files Browse the repository at this point in the history
  • Loading branch information
romange authored Jan 22, 2025
2 parents 6aaf68e + 69ef997 commit 4d47048
Show file tree
Hide file tree
Showing 19 changed files with 330 additions and 149 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,19 @@ jobs:
build-type: [Debug, Release]
compiler: [{ cxx: g++, c: gcc }]
cxx_flags: ["-Werror"]
sanitizers: ["NoSanitizers"]
include:
- container: "alpine-dev:latest"
build-type: Debug
compiler: { cxx: clang++, c: clang }
cxx_flags: ""
sanitizers: "NoSanitizers"
- container: "ubuntu-dev:24"
build-type: Debug
compiler: { cxx: clang++, c: clang }
# https://maskray.me/blog/2023-08-25-clang-wunused-command-line-argument (search for compiler-rt)
cxx_flags: "-Wno-error=unused-command-line-argument"
sanitizers: "Sanitizers"

runs-on: ubuntu-latest
env:
Expand All @@ -71,6 +80,7 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true

- name: Prepare Environment
run: |
uname -a
Expand All @@ -88,6 +98,7 @@ jobs:
df -h
touch /mnt/foo
ls -la /mnt/foo
- name: Run sccache-cache
uses: mozilla-actions/[email protected]

Expand All @@ -98,10 +109,35 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '')
- name: Install clang
if: matrix.sanitizers == 'Sanitizers'
run: |
# TODO remove this once the weekly is done
apt -y update
apt -y upgrade
apt install -y clang
which clang
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: |
echo "ulimit is"
ulimit -s
echo "-----------------------------"
echo "disk space is:"
df -h
echo "-----------------------------"
export ASAN="OFF"
export USAN="OFF"
if [ '${{matrix.sanitizers}}' = 'Sanitizers' ]; then
echo "ASAN/USAN"
export ASAN="ON"
export USAN="ON"
fi
# -no-pie to disable address randomization so we could symbolize stacktraces
cmake -B ${GITHUB_WORKSPACE}/build \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
Expand All @@ -110,7 +146,10 @@ jobs:
-DCMAKE_CXX_COMPILER="${{matrix.compiler.cxx}}" \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_FLAGS="${{matrix.cxx_flags}} -no-pie" -DWITH_AWS:BOOL=OFF \
-DWITH_ASAN="${ASAN}" \
-DWITH_USAN="${USAN}" \
-L
cd ${GITHUB_WORKSPACE}/build && pwd
du -hcs _deps/
Expand Down
107 changes: 0 additions & 107 deletions .github/workflows/daily-sanitizers.yml

This file was deleted.

7 changes: 7 additions & 0 deletions src/core/dash.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,13 @@ class DashTable<_Key, _Value, Policy>::Iterator {
return *this;
}

Iterator& AdvanceIfNotOccupied() {
if (!IsOccupied()) {
this->operator++();
}
return *this;
}

IteratorPairType operator->() const {
auto* seg = owner_->segment_[seg_id_];
return {seg->Key(bucket_id_, slot_id_), seg->Value(bucket_id_, slot_id_)};
Expand Down
2 changes: 1 addition & 1 deletion src/facade/conn_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ConnectionContext {
// connection state / properties.
bool conn_closing : 1;
bool req_auth : 1;
bool replica_conn : 1;
bool replica_conn : 1; // whether it's a replica connection on the master side.
bool authenticated : 1;
bool async_dispatch : 1; // whether this connection is amid an async dispatch
bool sync_dispatch : 1; // whether this connection is amid a sync dispatch
Expand Down
7 changes: 4 additions & 3 deletions src/facade/dragonfly_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,10 @@ Connection::~Connection() {
UpdateLibNameVerMap(lib_name_, lib_ver_, -1);
}

bool Connection::IsSending() const {
return reply_builder_ && reply_builder_->IsSendActive();
}

// Called from Connection::Shutdown() right after socket_->Shutdown call.
void Connection::OnShutdown() {
VLOG(1) << "Connection::OnShutdown";
Expand Down Expand Up @@ -1638,9 +1642,6 @@ bool Connection::Migrate(util::fb2::ProactorBase* dest) {

Connection::WeakRef Connection::Borrow() {
DCHECK(self_);
// If the connection is unaware of subscriptions, it could migrate threads, making this call
// unsafe. All external mechanisms that borrow references should register subscriptions.
DCHECK_GT(cc_->subscriptions, 0);

return WeakRef(self_, socket_->proactor()->GetPoolIndex(), id_);
}
Expand Down
10 changes: 10 additions & 0 deletions src/facade/dragonfly_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,16 @@ class Connection : public util::Connection {
static void TrackRequestSize(bool enable);
static void EnsureMemoryBudget(unsigned tid);

unsigned idle_time() const {
return time(nullptr) - last_interaction_;
}

Phase phase() const {
return phase_;
}

bool IsSending() const;

protected:
void OnShutdown() override;
void OnPreMigrateThread() override;
Expand Down
5 changes: 3 additions & 2 deletions src/server/blocking_controller_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class BlockingControllerTest : public Test {
}
void SetUp() override;
void TearDown() override;

static void SetUpTestSuite() {
ServerState::Init(kNumThreads, kNumThreads, nullptr);
ServerState::Init(kNumThreads, kNumThreads, nullptr, nullptr);
facade::tl_facade_stats = new facade::FacadeStats;
}

Expand All @@ -45,7 +46,7 @@ void BlockingControllerTest::SetUp() {
pp_.reset(fb2::Pool::Epoll(kNumThreads));
pp_->Run();
pp_->AwaitBrief([](unsigned index, ProactorBase* p) {
ServerState::Init(index, kNumThreads, nullptr);
ServerState::Init(index, kNumThreads, nullptr, nullptr);
if (facade::tl_facade_stats == nullptr) {
facade::tl_facade_stats = new facade::FacadeStats;
}
Expand Down
Loading

0 comments on commit 4d47048

Please sign in to comment.