From e04a149a97a8c9cf2191eff84c0c8ec686c5c7df Mon Sep 17 00:00:00 2001 From: Andy Lemin Date: Mon, 24 Aug 2026 14:21:37 +1000 Subject: [PATCH] cnid: sqlite-default residual cleanup; dsi: raise the listen backlog to 128 SQLite has been the default CNID scheme since PR #2265 made meson select sqlite > mysql > dbd among the compiled backends. Residue still said dbd: the docker entrypoint's AFP_CNID_BACKEND fallback, and the man page and NEWS never stated the default. Align them; no default changes here. The CI cnid:dbd spectest leg relied on the old docker fallback for its backend, so it now sets AFP_CNID_BACKEND=dbd explicitly -- intentional dbd and mysql coverage is unchanged. Also raise DSI_TCPMAXPEND from 20 to 128. It has been 20 since the CVS era, with no config knob; a reconnect storm (default 200 max connections) overflows it: dropped SYNs and ~1s client retransmit delays. 128 matches the common SOMAXCONN floor; the kernel silently caps at net.core.somaxconn anyway, so no new option is warranted. No steady-state effect. --- .github/workflows/containers.yml | 1 + NEWS.md | 8 ++++++++ distrib/docker/env_setup_netatalk.sh | 4 ++-- doc/manpages/man5/afp.conf.5.md | 1 + libatalk/dsi/dsi_tcp.c | 2 +- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index b3b9f189cee..0e8a7409713 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -478,6 +478,7 @@ jobs: -e AFP_DIRCACHE_RFORK_BUDGET=1048576 \ -e AFP_DIRCACHE_RFORK_MAXSIZE=1024 \ -e AFP_CONVERT_APPLEDOUBLE=no \ + -e AFP_CNID_BACKEND=dbd \ ${{ env.REGISTRY }}/netatalk/netatalk:${{ github.sha }} - name: Run Netatalk testsuite run: | diff --git a/NEWS.md b/NEWS.md index e7fd657a754..08462c69603 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,14 @@ Netatalk Changelog Changes in 4.6.0 ---------------- +* UPD: dsi: listen backlog raised from 20 to 128, absorbing reconnect + storms without dropped SYNs (the kernel still caps it at + net.core.somaxconn), GitHub #3267 +* UPD: cnid: the default CNID scheme has changed to *sqlite*: the build + system now selects sqlite > mysql > dbd among the compiled backends + (GitHub #3077), and the docker image's fallback for an unset + AFP_CNID_BACKEND now matches. The dbd backend remains available but is + deprecated, GitHub #3267 * UPD: netatalk: cnid_metad is now started only when a volume uses the dbd CNID scheme, and started or stopped on config reload as volumes change; previously it always ran when the dbd backend was compiled in, diff --git a/distrib/docker/env_setup_netatalk.sh b/distrib/docker/env_setup_netatalk.sh index 2028eb2221b..005804b5373 100644 --- a/distrib/docker/env_setup_netatalk.sh +++ b/distrib/docker/env_setup_netatalk.sh @@ -629,7 +629,7 @@ vol charset = ${AFP_VOL_CHARSET:-UTF8} spotlight = $AFP_SPOTLIGHT_GLOBAL spotlight backend = ${AFP_SPOTLIGHT_BACKEND:-cnid} [${SHARE_NAME:-File Sharing}] -cnid scheme = ${AFP_CNID_BACKEND:-dbd} +cnid scheme = ${AFP_CNID_BACKEND:-sqlite} ea = $AFP_EA path = $NETATALK_SHARE_DIR valid users = $AFP_VALIDUSERS1 @@ -638,7 +638,7 @@ $AFP_RWRO = $AFP_VALIDUSERS1 convert appledouble = ${AFP_CONVERT_APPLEDOUBLE:-no} spotlight = $AFP_SPOTLIGHT_GLOBAL [${SHARE_NAME2:-Time Machine}] -cnid scheme = ${AFP_CNID_BACKEND:-dbd} +cnid scheme = ${AFP_CNID_BACKEND:-sqlite} ea = $AFP_EA path = $NETATALK_BACKUP_DIR time machine = $TIMEMACHINE diff --git a/doc/manpages/man5/afp.conf.5.md b/doc/manpages/man5/afp.conf.5.md index 58ec55774f5..8fe2194513e 100644 --- a/doc/manpages/man5/afp.conf.5.md +++ b/doc/manpages/man5/afp.conf.5.md @@ -525,6 +525,7 @@ Requires datbase administration, giving you full control over how the CNID data > > *sqlite*: uses the SQLite embedded database library. It is performant and lean, requiring no external database or daemon. +This is the default backend when compiled in. cnid server = *host[:port]* **(G)**/**(V)** diff --git a/libatalk/dsi/dsi_tcp.c b/libatalk/dsi/dsi_tcp.c index dd6d851aefc..cc3207a4da2 100644 --- a/libatalk/dsi/dsi_tcp.c +++ b/libatalk/dsi/dsi_tcp.c @@ -48,7 +48,7 @@ int deny_severity = log_warning; #define min(a,b) ((a) < (b) ? (a) : (b)) #ifndef DSI_TCPMAXPEND -#define DSI_TCPMAXPEND 20 /*!< max # of pending connections */ +#define DSI_TCPMAXPEND 128 /*!< max # of pending connections */ #endif /* DSI_TCPMAXPEND */ #ifndef DSI_TCPTIMEOUT