Skip to content
Merged
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
95 changes: 95 additions & 0 deletions .github/workflows/asan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: ASAN (AddressSanitizer & LeakSanitizer)

# Memory error and leak detection using AddressSanitizer and LeakSanitizer
# This workflow builds memtier_benchmark with sanitizers enabled and runs
# the full test suite to detect memory leaks and address errors.

on: [push, pull_request]

jobs:
test-with-sanitizers:
runs-on: ubuntu-latest
name: Memory leak detection (ASAN/LSAN)
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install build dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y \
build-essential \
autoconf \
automake \
pkg-config \
libevent-dev \
zlib1g-dev \
libssl-dev

- name: Build with sanitizers
run: |
autoreconf -ivf
./configure --enable-sanitizers
make -j

- name: Verify ASAN is enabled
run: |
ldd ./memtier_benchmark | grep asan
echo "✓ AddressSanitizer is linked"

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
architecture: x64

- name: Install Python test dependencies
run: pip install -r ./tests/test_requirements.txt

- name: Install Redis
run: |
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get -qq update
sudo apt-get install redis
sudo service redis-server stop

- name: Increase connection limit
run: |
sudo sysctl -w net.ipv4.tcp_fin_timeout=10
sudo sysctl -w net.ipv4.tcp_tw_reuse=1
ulimit -n 40960

- name: Generate TLS test certificates
run: ./tests/gen-test-certs.sh

- name: Test OSS TCP with ASAN
timeout-minutes: 10
run: |
ASAN_OPTIONS=detect_leaks=1 ./tests/run_tests.sh

- name: Test OSS TCP TLS with ASAN
timeout-minutes: 10
run: |
ASAN_OPTIONS=detect_leaks=1 TLS=1 ./tests/run_tests.sh

- name: Test OSS TCP TLS v1.2 with ASAN
timeout-minutes: 10
run: |
ASAN_OPTIONS=detect_leaks=1 TLS_PROTOCOLS='TLSv1.2' TLS=1 ./tests/run_tests.sh

- name: Test OSS TCP TLS v1.3 with ASAN
timeout-minutes: 10
run: |
ASAN_OPTIONS=detect_leaks=1 TLS_PROTOCOLS='TLSv1.3' TLS=1 ./tests/run_tests.sh

- name: Test OSS-CLUSTER TCP with ASAN
timeout-minutes: 10
run: |
ASAN_OPTIONS=detect_leaks=1 OSS_STANDALONE=0 OSS_CLUSTER=1 ./tests/run_tests.sh

- name: Test OSS-CLUSTER TCP TLS with ASAN
timeout-minutes: 10
run: |
ASAN_OPTIONS=detect_leaks=1 OSS_STANDALONE=0 OSS_CLUSTER=1 TLS=1 ./tests/run_tests.sh

109 changes: 91 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: CI

# CI testing includes:
# - Debian versions: 11 (bullseye), 12 (bookworm), 13 (trixie), sid (unstable)
# - Various smoke test images (configurable via repository variables)
# - TLS and no-TLS builds
# - Code coverage and static analysis

on: [push, pull_request]

jobs:
Expand Down Expand Up @@ -30,36 +36,96 @@ jobs:
run: |
apt-get -qq update -y
apt-get install -y \
build-essential autoconf automake libpcre3-dev libevent-dev \
build-essential autoconf automake libevent-dev \
pkg-config zlib1g-dev libssl-dev libboost-all-dev cmake flex

- name: Build
run: autoreconf -ivf && ./configure && make -j

- name: Verify version, libevent, openssl
run: |
./memtier_benchmark --version
ldd ./memtier_benchmark | grep libevent
ldd ./memtier_benchmark | grep ssl

test-debian-versions:
runs-on: ubuntu-latest
continue-on-error: true
env:
DEBIAN_FRONTEND: noninteractive
strategy:
matrix:
debian_version:
- "debian:bullseye" # Debian 11 (oldstable)
- "debian:bookworm" # Debian 12 (stable)
- "debian:trixie" # Debian 13 (testing)
- "debian:sid" # Debian unstable
container: ${{ matrix.debian_version }}
name: Test ${{ matrix.debian_version }}
steps:
- name: Install git and basic tools
run: |
apt-get update -qq
apt-get install -y git ca-certificates

- name: Checkout code
uses: actions/checkout@v4

- name: Install build dependencies
run: |
apt-get update -qq
apt-get install -y \
build-essential \
autoconf \
automake \
pkg-config \
libevent-dev \
zlib1g-dev \
libssl-dev

- name: Build
run: autoreconf -ivf && ./configure && make -j

- name: Verify version, libevent, openssl
run: |
./memtier_benchmark --version
ldd ./memtier_benchmark | grep libevent
ldd ./memtier_benchmark | grep ssl

build-notls:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get -qq update
sudo apt-get install lcov autoconf automake pkg-config libevent-dev libpcre3-dev
sudo apt-get install lcov autoconf automake pkg-config libevent-dev

- name: Build
- name: Build without TLS
run: autoreconf -ivf && ./configure --disable-tls && make -j

- name: Verify version, libevent
run: |
./memtier_benchmark --version
ldd ./memtier_benchmark | grep libevent

build-ubuntu-latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get -qq update
sudo apt-get install lcov autoconf automake pkg-config libevent-dev libpcre3-dev
sudo apt-get install lcov autoconf automake pkg-config libevent-dev

- name: Build
- name: Build without TLS
run: autoreconf -ivf && ./configure --disable-tls && make -j

- name: Verify version, libevent, openssl
run: |
./memtier_benchmark --version
ldd ./memtier_benchmark | grep libevent

build-ubuntu:
strategy:
matrix:
Expand All @@ -70,7 +136,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get -qq update
sudo apt-get install lcov autoconf automake pkg-config libevent-dev libpcre3-dev libssl-dev
sudo apt-get install lcov autoconf automake pkg-config libevent-dev libssl-dev

- name: Build
# for coverage reports we need to use Ubuntu 22.04 or lower
Expand Down Expand Up @@ -159,29 +225,31 @@ jobs:
run: brew install autoconf automake libtool libevent openssl@${{ matrix.openssl }}
- name: Build
run: autoreconf -ivf && PKG_CONFIG_PATH=`brew --prefix openssl@${{ matrix.openssl }}`/lib/pkgconfig ./configure && make
- name: Verify version, libevent, openssl
run: |
./memtier_benchmark --version
otool -L ./memtier_benchmark | grep libevent
otool -L ./memtier_benchmark | grep ssl

# According to https://github.com/actions/runner-images/blob/macos-14-arm64/20241119.509/images/macos/macos-14-arm64-Readme.md
# [macOS] OpenSSL 1.1 will be removed and OpenSSL 3 will be the default for all macOS images from November 4, 2024
# so use macos-13 which does not have the deprecation notice
# macos-13 details: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
# macos-13 has been retired as of December 2025, so use macos-14
# macos-14 details: https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
build-macos-openssl-1-1:
strategy:
matrix:
platform: [macos-13]
runs-on: ${{ matrix.platform }}
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: brew install autoconf automake libtool libevent [email protected]
- name: Build
run: autoreconf -ivf && PKG_CONFIG_PATH=`brew --prefix [email protected]`/lib/pkgconfig ./configure && make
- name: Verify version, libevent, openssl
run: |
./memtier_benchmark --version
otool -L ./memtier_benchmark | grep libevent
otool -L ./memtier_benchmark | grep ssl


build-macos-openssl-1-0-2:
strategy:
matrix:
platform: [macos-13]
runs-on: ${{ matrix.platform }}
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install dependencies
Expand All @@ -190,3 +258,8 @@ jobs:
run: brew install rbenv/tap/[email protected]
- name: Build
run: autoreconf -ivf && PKG_CONFIG_PATH=`brew --prefix [email protected]`/lib/pkgconfig ./configure && make
- name: Verify version, libevent, openssl
run: |
./memtier_benchmark --version
otool -L ./memtier_benchmark | grep libevent
otool -L ./memtier_benchmark | grep ssl
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
default: "ubuntu-22.04"
type: string
permissions:
contents: read
contents: write # Required for creating releases and uploading assets
actions: read
jobs:
build-source-package:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
run: |
sudo apt-get update && \
sudo apt-get install \
build-essential autoconf automake libpcre3-dev libevent-dev \
build-essential autoconf automake libevent-dev \
pkg-config zlib1g-dev libssl-dev libboost-all-dev cmake flex \
debhelper dput
- name: Create changelog
Expand Down
90 changes: 90 additions & 0 deletions .github/workflows/tsan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: TSAN (ThreadSanitizer)

# Data race detection using ThreadSanitizer
# This workflow builds memtier_benchmark with TSAN enabled and runs
# tests to detect data races and threading issues.
#
# NOTE: TSAN currently detects known data races in the codebase.
# This workflow is informational and will not fail the build.
# See: https://github.com/google/sanitizers/issues/1716 for TSAN/ASLR issues

on: [push, pull_request]

jobs:
test-with-thread-sanitizer:
runs-on: ubuntu-latest
name: Data race detection (TSAN)
continue-on-error: true # Don't fail build on known races
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install build dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y \
build-essential \
autoconf \
automake \
pkg-config \
libevent-dev \
zlib1g-dev \
libssl-dev

- name: Build with Thread Sanitizer
run: |
autoreconf -ivf
./configure --enable-thread-sanitizer
make -j

- name: Verify TSAN is enabled
run: |
ldd ./memtier_benchmark | grep tsan
echo "✓ ThreadSanitizer is linked"

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
architecture: x64

- name: Install Python test dependencies
run: pip install -r ./tests/test_requirements.txt

- name: Install Redis
run: |
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get -qq update
sudo apt-get install redis
sudo service redis-server stop

- name: Increase connection limit
run: |
sudo sysctl -w net.ipv4.tcp_fin_timeout=10
sudo sysctl -w net.ipv4.tcp_tw_reuse=1
ulimit -n 40960

- name: Generate TLS test certificates
run: ./tests/gen-test-certs.sh

- name: Test OSS TCP with TSAN
timeout-minutes: 15
run: |
# Use setarch to disable ASLR (workaround for TSAN on kernel 6.6+)
# Use suppression file to ignore known benign races
export TSAN_OPTIONS="suppressions=$(pwd)/tsan_suppressions.txt"
setarch `uname -m` -R bash -c './tests/run_tests.sh'

- name: Test OSS TCP TLS with TSAN
timeout-minutes: 15
run: |
export TSAN_OPTIONS="suppressions=$(pwd)/tsan_suppressions.txt"
setarch `uname -m` -R bash -c 'TLS=1 ./tests/run_tests.sh'

- name: Test OSS-CLUSTER TCP with TSAN
timeout-minutes: 15
run: |
export TSAN_OPTIONS="suppressions=$(pwd)/tsan_suppressions.txt"
setarch `uname -m` -R bash -c 'OSS_STANDALONE=0 OSS_CLUSTER=1 ./tests/run_tests.sh'

Loading
Loading