Package: valkey-server
Version: 8.0.1+dfsg1-1~bpo12+1
Severity: important
X-Debbugs-Cc: k.f92000@selfhost.services

Dear Maintainer,

When using the Debian distribution of valkey-server with the RediSearch module 
compiled from sources,
RediSearch will fail to garbage collect via a fork due to restrictions imposed 
by the shipped systemd unit.
This failure results in the RediSearch-forked child pinning a core to 100% 
usage.

Reproduction steps:
 - Install valkey-server and load the upstream RediSearch module from a stable 
tag of RediSearch.
 - Create a RediSearch index (via FT.CREATE)
 - Cause a manual garbage collection to happen via the following valkey 
commands inside of valkey-cli:
   - `FT.CONFIG SET FORK_GC_CLEAN_THRESHOLD 0` # set the threshold to 0 for 
repro purposes
   - `_FT.DEBUG GC_FORCEINVOKE` # invoke the gc

 The above steps should cause an output in the Valkey logs such as "* Module 
fork exited pid: 0000, retcode: -1, bysignal: 31"

This problem seems to stem from the `SystemCallFilter=~ @privileged @resources` 
line in the generated systemd unit, as RediSearch
expects that the `setpriority` syscall (included in the `@resources` group 
isn't restricted.
 -> Likely cause of hang in RediSearch: 
https://github.com/RediSearch/RediSearch/blob/eb14b957216bfdb02ae13fce3561e444992dd906/src/fork_gc.c#L1306

Removing that line from the unit file seems to fix the issue.

-- System Information:
Debian Release: 12.9
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-30-amd64 (SMP w/6 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages valkey-server depends on:
ii  init-system-helpers  1.65.2
ii  valkey-tools         8.0.1+dfsg1-1~bpo12+1

valkey-server recommends no packages.

valkey-server suggests no packages.

-- Configuration Files:
/etc/valkey/valkey.conf changed [not included]

-- no debconf information

Reply via email to