8000 Blocked in use by harrylin98 · Pull Request #19 · JimB123/valkey · GitHub
[go: up one dir, main page]

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
81bd5bd
Introduce GoogleTest framework for Valkey unit testing (#2956)
harrylin98 Jan 14, 2026
f766e99
Fix unnecessary recompilation in gtest Makefile (#3063)
harrylin98 Jan 15, 2026
329ac61
Blocked_inuse
harrylhl Jan 29, 2026
28aa8c8
Combine the unblocked client lists
harrylhl Feb 4, 2026
4160328
Merge branch 'valkey-io:unstable' into blockedInUse
harrylin98 Feb 4, 2026
30ef060
Merge remote-tracking branch 'origin/unstable' into feature-gtest
madolson Feb 9, 2026
476c5c8
Format code
harrylhl Feb 4, 2026
2af800b
Merge upstream unstable into feature-gtest
madolson Feb 17, 2026
014adf1
Convert Valkey C unit tests to GTEST (#3187)
asagege Feb 19, 2026
df1d5f3
Merge unstable into feature-gtest (#3240)
harrylin98 Feb 21, 2026
4aff5f9
Merge branch 'unstable' into Feb20_final_merge
harrylhl Feb 21, 2026
cec912c
Merge branch 'unstable' into Feb20_final_merge
harrylin98 Feb 23, 2026
e9b10e5
Merge branch 'unstable' into Feb20_final_merge
harrylin98 Feb 24, 2026
d2eef6a
Address comments
harrylhl Feb 13, 2026
2188288
Merge branch 'Feb20_final_merge' into blockedInUse
harrylin98 Feb 25, 2026
3be5a11
Adding unit test
harrylin98 Feb 25, 2026
79bab14
Merge branch 'unstable' into blockedInUse
harrylin98 Feb 27, 2026
9f01067
Changed LUA module dependency (#3325)
eifrah-aws Mar 9, 2026
3d8a1b5
Replace long long timestamp references with more specific mstime_t/us…
curious-george-rk Mar 9, 2026
b112f8a
Add connections check in unit test
harrylin98 Feb 28, 2026
8caa292
Adds cluster benchmark support for benchmark-on-label (#3338)
roshkhatri Mar 9, 2026
0ff55de
Make the number of healthy nodes in gossip section configurable (#2746)
hpatro Mar 9, 2026
8dee168
Fixing memory leak in unit test
harrylin98 Mar 9, 2026
cddeeb2
Merge branch 'valkey-io:unstable' into blockedInUse
harrylin98 Mar 9, 2026
5deebd0
[flaky-tests] atomically snapshot dual-channel memory stats (#3336)
sarthakaggarwal97 Mar 9, 2026
9dcc5a3
Merge branch 'valkey-io:unstable' into blockedInUse
harrylin98 Mar 9, 2026
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
20 changes: 16 additions & 4 deletions .github/workflows/benchmark-on-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ permissions:
jobs:
benchmark:
if: |
github.event.action == 'labeled' && github.event.label.name == 'run-benchmark' &&
github.event.action == 'labeled' &&
(github.event.label.name == 'run-benchmark' || github.event.label.name == 'run-cluster-benchmark') &&
github.repository == 'valkey-io/valkey'

runs-on: ["self-hosted", "ec2-al-2023-pr-benchmarking-arm64"]
Expand Down Expand Up @@ -86,6 +87,15 @@ jobs:
echo "VALKEY_BENCHMARK_PATH=$VALKEY_BENCHMARK_PATH" >> $GITHUB_ENV
echo "Latest valkey-benchmark path: $VALKEY_BENCHMARK_PATH"

- name: Enable cluster mode in benchmark config
working-directory: valkey-perf-benchmark
if: github.event.label.name == 'run-cluster-benchmark'
run: |
CONFIG_FILE="../valkey/.github/benchmark_configs/benchmark-config-arm.json"
sed -i 's/"cluster_mode": false/"cluster_mode": true/g' "$CONFIG_FILE"
echo "Updated config for cluster mode:"
cat "$CONFIG_FILE"

- name: Run benchmarks
working-directory: valkey-perf-benchmark
run: |
Expand Down Expand Up @@ -120,7 +130,7 @@ jobs:
continue-on-error: true
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: benchmark-results
name: ${{ github.event.label.name }}-results
path: |
./valkey-perf-benchmark/results/${{ github.event.pull_request.merge_commit_sha }}/metrics.json
./valkey-perf-benchmark/results/${{ github.event.pull_request.base.ref }}/metrics.json
Expand All @@ -137,11 +147,13 @@ jobs:
const sha = '${{ github.event.pull_request.head.sha }}';
const short = sha.slice(0,7);
const link = `[\`${short}\`](https://github.com/${owner}/${repo}/commit/${sha})`
const label = '${{ github.event.label.name }}';
const prefix = label === 'run-cluster-benchmark' ? 'Cluster Benchmark' : 'Benchmark';
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner,
repo,
body: `**Benchmark ran on this commit:** ${link}\n\n${body}`
body: `**${prefix} ran on this commit:** ${link}\n\n${body}`
});

- name: Cleanup any running valkey processes
Expand All @@ -160,7 +172,7 @@ jobs:
fi

- name: Remove ${{ github.event.label.name }} label
if: always() && github.event.label.name == 'run-benchmark'
if: always() && (github.event.label.name == 'run-benchmark' || github.event.label.name == 'run-cluster-benchmark')
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions cmake/Modules/SourceFiles.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ set(VALKEY_SERVER_SRCS
${CMAKE_SOURCE_DIR}/src/notify.c
${CMAKE_SOURCE_DIR}/src/setproctitle.c
${CMAKE_SOURCE_DIR}/src/blocked.c
${CMAKE_SOURCE_DIR}/src/blocked_inuse.c
${CMAKE_SOURCE_DIR}/src/hyperloglog.c
${CMAKE_SOURCE_DIR}/src/latency.c
${CMAKE_SOURCE_DIR}/src/sparkline.c
Expand Down
26 changes: 22 additions & 4 deletions deps/lua/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,28 @@ MYCFLAGS=
MYLDFLAGS=
MYLIBS=

# Pretty-printing setup
CC_COLOR="\033[32m"
LNK_COLOR="\033[36;1m"
SCOPE_COLOR="\033[38:5:250m"
SRC_COLOR="\033[33m"
BIN_COLOR="\033[35m"
RESET="\033[0m"

ifndef V
QUIET_CC = @printf ' %b %b(LUA Lib)%b %b\n' $(CC_COLOR)CC$(RESET) $(SCOPE_COLOR) $(RESET) $(SRC_COLOR)$<$(RESET) 1>&2;
QUIET_LINK = @printf ' %b %b\n' $(LNK_COLOR)LINK$(RESET) $(BIN_COLOR)$@$(RESET) 1>&2;
QUIET_AR = @printf ' %b %b\n' $(CC_COLOR)ARCHIVE$(RESET) $(BIN_COLOR)$@$(RESET) 1>&2;
endif

# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========

PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris

# Explicit pattern rule for building object files from C sources
%.o: %.c
$(QUIET_CC)$(CC) $(CFLAGS) -c $< -o $@

LUA_A= liblua.a
CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
Expand Down Expand Up @@ -49,14 +67,14 @@ o: $(ALL_O)
a: $(ALL_A)

$(LUA_A): $(CORE_O) $(LIB_O)
$(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
$(RANLIB) $@
$(QUIET_AR)$(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
$(QUIET_AR)$(RANLIB) $@

$(LUA_T): $(LUA_O) $(LUA_A)
$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
$(QUIET_LINK)$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)

$(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
$(QUIET_LINK)$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)

clean:
$(RM) $(ALL_T) $(ALL_O)
Expand Down
9 changes: 5 additions & 4 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ ENGINE_SERVER_OBJ = \
bio.o \
bitops.o \
blocked.o \
blocked_inuse.o \
call_reply.o \
childinfo.o \
cluster.o \
Expand Down Expand Up @@ -639,7 +640,7 @@ endif

DEPENDENCY_TARGETS+= gtest-parallel

ALL_BUILD_PREREQUISITES=$(SERVER_NAME) $(ENGINE_SENTINEL_NAME) $(ENGINE_CLI_NAME) $(ENGINE_BENCHMARK_NAME) $(ENGINE_CHECK_RDB_NAME) $(ENGINE_CHECK_AOF_NAME) $(TLS_MODULE) $(RDMA_MODULE) $(LUA_MODULE)
ALL_BUILD_PREREQUISITES=$(SERVER_NAME) $(ENGINE_SENTINEL_NAME) $(ENGINE_CLI_NAME) $(ENGINE_BENCHMARK_NAME) $(ENGINE_CHECK_RDB_NAME) $(ENGINE_CHECK_AOF_NAME) $(TLS_MODULE) $(RDMA_MODULE)

all: $(ALL_BUILD_PREREQUISITES)
@echo ""
Expand Down Expand Up @@ -696,8 +697,8 @@ ifneq ($(strip $(PREV_FINAL_LDFLAGS)), $(strip $(FINAL_LDFLAGS)))
endif

# valkey-server
$(SERVER_NAME): $(ENGINE_SERVER_OBJ)
$(SERVER_LD) -o $@ $^ ../deps/libvalkey/lib/libvalkey.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)
$(SERVER_NAME): $(ENGINE_SERVER_OBJ) $(LUA_MODULE)
$(SERVER_LD) -o $@ $(ENGINE_SERVER_OBJ) ../deps/libvalkey/lib/libvalkey.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)

# Valkey static library, used to compile against for unit testing
$(ENGINE_LIB_NAME): $(ENGINE_SERVER_OBJ)
Expand All @@ -724,7 +725,7 @@ $(RDMA_MODULE_NAME): $(SERVER_NAME)
$(QUIET_CC)$(CC) -o $@ rdma.c -shared -fPIC $(RDMA_MODULE_CFLAGS)

# engine_lua.so
$(LUA_MODULE_NAME): $(SERVER_NAME)
$(LUA_MODULE_NAME): .make-prerequisites
cd modules/lua && $(MAKE) OPTIMIZATION="$(OPTIMIZATION)"

# valkey-cli
Expand Down
14 changes: 13 additions & 1 deletion src/blocked.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#include "monotonic.h"
#include "cluster_slot_stats.h"
#include "module.h"
#include "blocked_inuse.h"

/* forward declarations */
static void unblockClientWaitingData(client *c);
Expand Down Expand Up @@ -160,10 +161,13 @@ void processUnblockedClients(void) {
client *c;

while (listLength(server.unblocked_clients)) {
// If one of the unblocked clients executed pause command, then we stop processing further.
if (isPausedActionsWithUpdate(PAUSE_ACTIONS_CLIENT_ALL_SET)) return;
ln = listFirst(server.unblocked_clients);
serverAssert(ln != NULL);
c = ln->value;
listDelNode(server.unblocked_clients, ln);
serverAssert(!blockInuse_clientBlocked(c));
c->flag.unblocked = 0;

if (c->flag.module) {
Expand All @@ -173,6 +177,14 @@ void processUnblockedClients(void) {
continue;
}

/* Reinstall read handler if it was removed (e.g. by blockInuse) */
if (c->conn && !connHasReadHandler(c->conn)) {
// If it fails because epoll_ctl failed then freeClient.
if (connSetReadHandler(c->conn, readQueryFromClient) == C_ERR) {
freeClient(c);
return;
}
}
/* Process remaining data in the input buffer, unless the client
* is blocked again. Actually processInputBuffer() checks that the
* client is not blocked before to proceed, but things may change and
Expand All @@ -183,7 +195,7 @@ void processUnblockedClients(void) {
continue;
}
}
beforeNextClient(c);
if (!c->flag.close_asap) beforeNextClient(c);
}
}

Expand Down
Loading
Loading
0