Bug 234753

Summary: net/samba47: socket queue overflow stalls server
Product: Ports & Packages Reporter: Michael Osipov <michael.osipov>
Component: Individual Port(s)Assignee: Timur I. Bakeyev <timur>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: rene
Priority: --- Flags: bugzilla: maintainer-feedback? (timur)
Version: Latest   
Hardware: Any   
OS: Any   

Description Michael Osipov 2019-01-08 15:29:42 UTC
Our server (FreeBSD 11.2-STABLE i386) recently stalled several times with the following in the logs:

> Jan  8 09:31:30 blnn714x kernel: sonewconn: pcb 0xc85c4be0: Listen queue overflow: 193 already in queue awaiting acceptance (25 occurrences)
> Jan  8 09:32:47 blnn714x kernel: sonewconn: pcb 0xc85c4be0: Listen queue overflow: 193 already in queue awaiting acceptance (2 occurrences)
> Jan  8 09:33:58 blnn714x kernel: sonewconn: pcb 0xc85c4be0: Listen queue overflow: 193 already in queue awaiting acceptance (6 occurrences)
> Jan  8 09:39:30 blnn714x kernel: sonewconn: pcb 0xc85c4be0: Listen queue overflow: 193 already in queue awaiting acceptance (2 occurrences)

A similar issue has been reported on the Samba mailing list a year ago (https://lists.samba.org/archive/samba/2018-January/213309.html). The socket queue is too small and hardcoded in Samba:

> Current listen queue sizes (qlen/incqlen/maxqlen)
> Proto Listen                           Local Address
> tcp4  0/0/128                          *.22
> tcp4  0/0/50                           147.54.64.14.139
> tcp4  0/0/50                           147.54.64.14.445

A decent patch was provided (https://lists.samba.org/archive/samba/2018-January/213321.html, https://people.ifm.liu.se/peter/patches/samba/socket_listen_backlog.patch) though not yet applied.

I requested this on samba-technical (https://lists.samba.org/archive/samba-technical/2019-January/131870.html). While this might take time, can we apply this patch to 4.7 and 4.8 to easy the issue and raise connection queue length?

The patch looks straight-forward to me.
Comment 1 Rene Ladan freebsd_committer freebsd_triage 2019-08-19 10:00:47 UTC
samba47 expired today, please use samba48 or samba410.