Author: trasz
Date: Thu Jan 17 20:01:06 2019
New Revision: 343121
URL: https://svnweb.freebsd.org/changeset/base/343121

Log:
  Workaround for nscd(8) failure with large entries.
  
  It fixes a case where eg a 2KB group entry would take several seconds
  to complete with cache enabled in nsswitch.conf.
  
  MFC after:    2 weeks
  Sponsored by: Chalmers University of Technology
  Differential Revision:        https://reviews.freebsd.org/D18392

Modified:
  head/usr.sbin/nscd/nscd.c

Modified: head/usr.sbin/nscd/nscd.c
==============================================================================
--- head/usr.sbin/nscd/nscd.c   Thu Jan 17 19:44:47 2019        (r343120)
+++ head/usr.sbin/nscd/nscd.c   Thu Jan 17 20:01:06 2019        (r343121)
@@ -405,6 +405,12 @@ process_socket_event(struct kevent *event_data, struct
                 * process_socket_event).
                 */
                if (qstate->kevent_watermark > MAX_SOCKET_IO_SIZE) {
+#if 0
+                       /*
+                        * XXX: Uncommenting this code makes nscd(8) fail for
+                        *      entries larger than a few kB, causing few second
+                        *      worth of delay for each call to retrieve them.
+                        */
                        if (qstate->io_buffer != NULL)
                                free(qstate->io_buffer);
 
@@ -421,6 +427,7 @@ process_socket_event(struct kevent *event_data, struct
 
                        if (qstate->kevent_filter == EVFILT_READ)
                                qstate->use_alternate_io = 1;
+#endif
 
                        qstate->io_buffer_watermark = MAX_SOCKET_IO_SIZE;
                        EV_SET(&eventlist[1], event_data->ident,
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to