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
This commit is contained in:
Rick Macklem 2025-10-10 16:29:25 -07:00
parent 9934558460
commit 7a289fe3cd

View file

@ -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] = '@';