Skip to content

Commit bf130a2

Browse files
Merge remote-tracking branch 'origin/master' into HEAD
2 parents bd6343c + 4a8ac10 commit bf130a2

37 files changed

+2576
-213
lines changed

.github/workflows/asan.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: ASAN (AddressSanitizer & LeakSanitizer)
2+
3+
# Memory error and leak detection using AddressSanitizer and LeakSanitizer
4+
# This workflow builds memtier_benchmark with sanitizers enabled and runs
5+
# the full test suite to detect memory leaks and address errors.
6+
7+
on: [push, pull_request]
8+
9+
jobs:
10+
test-with-sanitizers:
11+
runs-on: ubuntu-latest
12+
name: Memory leak detection (ASAN/LSAN)
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Install build dependencies
18+
run: |
19+
sudo apt-get -qq update
20+
sudo apt-get install -y \
21+
build-essential \
22+
autoconf \
23+
automake \
24+
pkg-config \
25+
libevent-dev \
26+
zlib1g-dev \
27+
libssl-dev
28+
29+
- name: Build with sanitizers
30+
run: |
31+
autoreconf -ivf
32+
./configure --enable-sanitizers
33+
make -j
34+
35+
- name: Verify ASAN is enabled
36+
run: |
37+
ldd ./memtier_benchmark | grep asan
38+
echo "✓ AddressSanitizer is linked"
39+
40+
- name: Setup Python
41+
uses: actions/setup-python@v2
42+
with:
43+
python-version: '3.10'
44+
architecture: x64
45+
46+
- name: Install Python test dependencies
47+
run: pip install -r ./tests/test_requirements.txt
48+
49+
- name: Install Redis
50+
run: |
51+
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
52+
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
53+
sudo apt-get -qq update
54+
sudo apt-get install redis
55+
sudo service redis-server stop
56+
57+
- name: Increase connection limit
58+
run: |
59+
sudo sysctl -w net.ipv4.tcp_fin_timeout=10
60+
sudo sysctl -w net.ipv4.tcp_tw_reuse=1
61+
ulimit -n 40960
62+
63+
- name: Generate TLS test certificates
64+
run: ./tests/gen-test-certs.sh
65+
66+
- name: Test OSS TCP with ASAN
67+
timeout-minutes: 10
68+
run: |
69+
ASAN_OPTIONS=detect_leaks=1 ./tests/run_tests.sh
70+
71+
- name: Test OSS TCP TLS with ASAN
72+
timeout-minutes: 10
73+
run: |
74+
ASAN_OPTIONS=detect_leaks=1 TLS=1 ./tests/run_tests.sh
75+
76+
- name: Test OSS TCP TLS v1.2 with ASAN
77+
timeout-minutes: 10
78+
run: |
79+
ASAN_OPTIONS=detect_leaks=1 TLS_PROTOCOLS='TLSv1.2' TLS=1 ./tests/run_tests.sh
80+
81+
- name: Test OSS TCP TLS v1.3 with ASAN
82+
timeout-minutes: 10
83+
run: |
84+
ASAN_OPTIONS=detect_leaks=1 TLS_PROTOCOLS='TLSv1.3' TLS=1 ./tests/run_tests.sh
85+
86+
- name: Test OSS-CLUSTER TCP with ASAN
87+
timeout-minutes: 10
88+
run: |
89+
ASAN_OPTIONS=detect_leaks=1 OSS_STANDALONE=0 OSS_CLUSTER=1 ./tests/run_tests.sh
90+
91+
- name: Test OSS-CLUSTER TCP TLS with ASAN
92+
timeout-minutes: 10
93+
run: |
94+
ASAN_OPTIONS=detect_leaks=1 OSS_STANDALONE=0 OSS_CLUSTER=1 TLS=1 ./tests/run_tests.sh
95+

.github/workflows/ci.yml

Lines changed: 91 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: CI
22

3+
# CI testing includes:
4+
# - Debian versions: 11 (bullseye), 12 (bookworm), 13 (trixie), sid (unstable)
5+
# - Various smoke test images (configurable via repository variables)
6+
# - TLS and no-TLS builds
7+
# - Code coverage and static analysis
8+
39
on: [push, pull_request]
410

511
jobs:
@@ -30,36 +36,96 @@ jobs:
3036
run: |
3137
apt-get -qq update -y
3238
apt-get install -y \
33-
build-essential autoconf automake libpcre3-dev libevent-dev \
39+
build-essential autoconf automake libevent-dev \
3440
pkg-config zlib1g-dev libssl-dev libboost-all-dev cmake flex
3541
3642
- name: Build
3743
run: autoreconf -ivf && ./configure && make -j
3844

45+
- name: Verify version, libevent, openssl
46+
run: |
47+
./memtier_benchmark --version
48+
ldd ./memtier_benchmark | grep libevent
49+
ldd ./memtier_benchmark | grep ssl
50+
51+
test-debian-versions:
52+
runs-on: ubuntu-latest
53+
continue-on-error: true
54+
env:
55+
DEBIAN_FRONTEND: noninteractive
56+
strategy:
57+
matrix:
58+
debian_version:
59+
- "debian:bullseye" # Debian 11 (oldstable)
60+
- "debian:bookworm" # Debian 12 (stable)
61+
- "debian:trixie" # Debian 13 (testing)
62+
- "debian:sid" # Debian unstable
63+
container: ${{ matrix.debian_version }}
64+
name: Test ${{ matrix.debian_version }}
65+
steps:
66+
- name: Install git and basic tools
67+
run: |
68+
apt-get update -qq
69+
apt-get install -y git ca-certificates
70+
71+
- name: Checkout code
72+
uses: actions/checkout@v4
73+
74+
- name: Install build dependencies
75+
run: |
76+
apt-get update -qq
77+
apt-get install -y \
78+
build-essential \
79+
autoconf \
80+
automake \
81+
pkg-config \
82+
libevent-dev \
83+
zlib1g-dev \
84+
libssl-dev
85+
86+
- name: Build
87+
run: autoreconf -ivf && ./configure && make -j
88+
89+
- name: Verify version, libevent, openssl
90+
run: |
91+
./memtier_benchmark --version
92+
ldd ./memtier_benchmark | grep libevent
93+
ldd ./memtier_benchmark | grep ssl
94+
3995
build-notls:
4096
runs-on: ubuntu-latest
4197
steps:
4298
- uses: actions/checkout@v4
4399
- name: Install dependencies
44100
run: |
45101
sudo apt-get -qq update
46-
sudo apt-get install lcov autoconf automake pkg-config libevent-dev libpcre3-dev
102+
sudo apt-get install lcov autoconf automake pkg-config libevent-dev
47103
48-
- name: Build
104+
- name: Build without TLS
49105
run: autoreconf -ivf && ./configure --disable-tls && make -j
50106

107+
- name: Verify version, libevent
108+
run: |
109+
./memtier_benchmark --version
110+
ldd ./memtier_benchmark | grep libevent
111+
51112
build-ubuntu-latest:
52113
runs-on: ubuntu-latest
53114
steps:
54115
- uses: actions/checkout@v4
55116
- name: Install dependencies
56117
run: |
57118
sudo apt-get -qq update
58-
sudo apt-get install lcov autoconf automake pkg-config libevent-dev libpcre3-dev
119+
sudo apt-get install lcov autoconf automake pkg-config libevent-dev
59120
60-
- name: Build
121+
- name: Build without TLS
61122
run: autoreconf -ivf && ./configure --disable-tls && make -j
62123

124+
- name: Verify version, libevent, openssl
125+
run: |
126+
./memtier_benchmark --version
127+
ldd ./memtier_benchmark | grep libevent
128+
63129
build-ubuntu:
64130
strategy:
65131
matrix:
@@ -70,7 +136,7 @@ jobs:
70136
- name: Install dependencies
71137
run: |
72138
sudo apt-get -qq update
73-
sudo apt-get install lcov autoconf automake pkg-config libevent-dev libpcre3-dev libssl-dev
139+
sudo apt-get install lcov autoconf automake pkg-config libevent-dev libssl-dev
74140
75141
- name: Build
76142
# for coverage reports we need to use Ubuntu 22.04 or lower
@@ -159,29 +225,31 @@ jobs:
159225
run: brew install autoconf automake libtool libevent openssl@${{ matrix.openssl }}
160226
- name: Build
161227
run: autoreconf -ivf && PKG_CONFIG_PATH=`brew --prefix openssl@${{ matrix.openssl }}`/lib/pkgconfig ./configure && make
228+
- name: Verify version, libevent, openssl
229+
run: |
230+
./memtier_benchmark --version
231+
otool -L ./memtier_benchmark | grep libevent
232+
otool -L ./memtier_benchmark | grep ssl
162233
163-
# According to https://github.com/actions/runner-images/blob/macos-14-arm64/20241119.509/images/macos/macos-14-arm64-Readme.md
164-
# [macOS] OpenSSL 1.1 will be removed and OpenSSL 3 will be the default for all macOS images from November 4, 2024
165-
# so use macos-13 which does not have the deprecation notice
166-
# macos-13 details: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
234+
# macos-13 has been retired as of December 2025, so use macos-14
235+
# macos-14 details: https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
167236
build-macos-openssl-1-1:
168-
strategy:
169-
matrix:
170-
platform: [macos-13]
171-
runs-on: ${{ matrix.platform }}
237+
runs-on: macos-14
172238
steps:
173239
- uses: actions/checkout@v4
174240
- name: Install dependencies
175241
run: brew install autoconf automake libtool libevent openssl@1.1
176242
- name: Build
177243
run: autoreconf -ivf && PKG_CONFIG_PATH=`brew --prefix openssl@1.1`/lib/pkgconfig ./configure && make
244+
- name: Verify version, libevent, openssl
245+
run: |
246+
./memtier_benchmark --version
247+
otool -L ./memtier_benchmark | grep libevent
248+
otool -L ./memtier_benchmark | grep ssl
178249
179250
180251
build-macos-openssl-1-0-2:
181-
strategy:
182-
matrix:
183-
platform: [macos-13]
184-
runs-on: ${{ matrix.platform }}
252+
runs-on: macos-14
185253
steps:
186254
- uses: actions/checkout@v4
187255
- name: Install dependencies
@@ -190,3 +258,8 @@ jobs:
190258
run: brew install rbenv/tap/openssl@1.0
191259
- name: Build
192260
run: autoreconf -ivf && PKG_CONFIG_PATH=`brew --prefix openssl@1.0`/lib/pkgconfig ./configure && make
261+
- name: Verify version, libevent, openssl
262+
run: |
263+
./memtier_benchmark --version
264+
otool -L ./memtier_benchmark | grep libevent
265+
otool -L ./memtier_benchmark | grep ssl

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
default: "ubuntu-22.04"
2424
type: string
2525
permissions:
26-
contents: read
26+
contents: write # Required for creating releases and uploading assets
2727
actions: read
2828
jobs:
2929
build-source-package:
@@ -62,7 +62,7 @@ jobs:
6262
run: |
6363
sudo apt-get update && \
6464
sudo apt-get install \
65-
build-essential autoconf automake libpcre3-dev libevent-dev \
65+
build-essential autoconf automake libevent-dev \
6666
pkg-config zlib1g-dev libssl-dev libboost-all-dev cmake flex \
6767
debhelper dput
6868
- name: Create changelog

.github/workflows/tsan.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: TSAN (ThreadSanitizer)
2+
3+
# Data race detection using ThreadSanitizer
4+
# This workflow builds memtier_benchmark with TSAN enabled and runs
5+
# tests to detect data races and threading issues.
6+
#
7+
# NOTE: TSAN currently detects known data races in the codebase.
8+
# This workflow is informational and will not fail the build.
9+
# See: https://github.com/google/sanitizers/issues/1716 for TSAN/ASLR issues
10+
11+
on: [push, pull_request]
12+
13+
jobs:
14+
test-with-thread-sanitizer:
15+
runs-on: ubuntu-latest
16+
name: Data race detection (TSAN)
17+
continue-on-error: true # Don't fail build on known races
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Install build dependencies
23+
run: |
24+
sudo apt-get -qq update
25+
sudo apt-get install -y \
26+
build-essential \
27+
autoconf \
28+
automake \
29+
pkg-config \
30+
libevent-dev \
31+
zlib1g-dev \
32+
libssl-dev
33+
34+
- name: Build with Thread Sanitizer
35+
run: |
36+
autoreconf -ivf
37+
./configure --enable-thread-sanitizer
38+
make -j
39+
40+
- name: Verify TSAN is enabled
41+
run: |
42+
ldd ./memtier_benchmark | grep tsan
43+
echo "✓ ThreadSanitizer is linked"
44+
45+
- name: Setup Python
46+
uses: actions/setup-python@v2
47+
with:
48+
python-version: '3.10'
49+
architecture: x64
50+
51+
- name: Install Python test dependencies
52+
run: pip install -r ./tests/test_requirements.txt
53+
54+
- name: Install Redis
55+
run: |
56+
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
57+
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
58+
sudo apt-get -qq update
59+
sudo apt-get install redis
60+
sudo service redis-server stop
61+
62+
- name: Increase connection limit
63+
run: |
64+
sudo sysctl -w net.ipv4.tcp_fin_timeout=10
65+
sudo sysctl -w net.ipv4.tcp_tw_reuse=1
66+
ulimit -n 40960
67+
68+
- name: Generate TLS test certificates
69+
run: ./tests/gen-test-certs.sh
70+
71+
- name: Test OSS TCP with TSAN
72+
timeout-minutes: 15
73+
run: |
74+
# Use setarch to disable ASLR (workaround for TSAN on kernel 6.6+)
75+
# Use suppression file to ignore known benign races
76+
export TSAN_OPTIONS="suppressions=$(pwd)/tsan_suppressions.txt"
77+
setarch `uname -m` -R bash -c './tests/run_tests.sh'
78+
79+
- name: Test OSS TCP TLS with TSAN
80+
timeout-minutes: 15
81+
run: |
82+
export TSAN_OPTIONS="suppressions=$(pwd)/tsan_suppressions.txt"
83+
setarch `uname -m` -R bash -c 'TLS=1 ./tests/run_tests.sh'
84+
85+
- name: Test OSS-CLUSTER TCP with TSAN
86+
timeout-minutes: 15
87+
run: |
88+
export TSAN_OPTIONS="suppressions=$(pwd)/tsan_suppressions.txt"
89+
setarch `uname -m` -R bash -c 'OSS_STANDALONE=0 OSS_CLUSTER=1 ./tests/run_tests.sh'
90+

0 commit comments

Comments
 (0)