git: 7a289fe3cd5c - main - rpc.tlsservd.c: Pin max threads at 1 for now

From: Rick Macklem <rmacklem_at_FreeBSD.org>
Date: Fri, 10 Oct 2025 23:32:29 UTC
The branch main has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=7a289fe3cd5c6de7ddbe394b7700b20b0bafdb3e

commit 7a289fe3cd5c6de7ddbe394b7700b20b0bafdb3e
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2025-10-10 23:29:25 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2025-10-10 23:29:25 +0000

    rpc.tlsservd.c: Pin max threads at 1 for now
    
    PR#289734 reports a crash in tcp_use_close() when the rpc.tlsservd
    daemon is being used.  Although I have no, as yet, had time to track
    down/fix the race, it turns out setting rpctls_maxthreads to 1
    avoids the problem.
    
    This patch pins rpctls_maxthreads to 1 to avoid the problem,
    until there is a proper fix.
    
    PR:     289734
    MFC after:      3 days
---
 usr.sbin/rpc.tlsservd/rpc.tlsservd.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/usr.sbin/rpc.tlsservd/rpc.tlsservd.c b/usr.sbin/rpc.tlsservd/rpc.tlsservd.c
index f07385a2baa7..fb0501b2db4c 100644
--- a/usr.sbin/rpc.tlsservd/rpc.tlsservd.c
+++ b/usr.sbin/rpc.tlsservd/rpc.tlsservd.c
@@ -168,7 +168,12 @@ main(int argc, char **argv)
 
 	rpctls_verbose = false;
 	ncpu = (u_int)sysconf(_SC_NPROCESSORS_ONLN);
+#ifdef notnow
 	rpctls_maxthreads = ncpu > 1 ? ncpu / 2 : 1;
+#else
+	/* XXX For now, until fixed properly!! */
+	rpctls_maxthreads = 1;
+#endif
 
 	while ((ch = getopt_long(argc, argv, "2C:D:dhl:N:n:mp:r:uvWw", longopts,
 	    NULL)) != -1) {
@@ -199,6 +204,8 @@ main(int argc, char **argv)
 			if (rpctls_maxthreads < 1 || rpctls_maxthreads > ncpu)
 				errx(1, "maximum threads must be between 1 and "
 				    "number of CPUs (%d)", ncpu);
+			/* XXX For now, until fixed properly!! */
+			rpctls_maxthreads = 1;
 			break;
 		case 'n':
 			hostname[0] = '@';