From d400bc1dd76421261b4ce8c317ccc04b938c003b Mon Sep 17 00:00:00 2001 From: Matus Honek Date: Oct 31 2019 11:19:23 +0000 Subject: Issue 50669 - Remove nunc-stans in favour of reworking current conn code (add.) Bug Description: There are a bit more pieces that should be removed for the ticket. Fix Description: Remove some additional code. Some documentation still left in place for reference. Relates https://pagure.io/389-ds-base/issue/50669 Author: Matus Honek Review by: mreynolds, firstyear (thanks!) --- diff --git a/Makefile.am b/Makefile.am index d847604..5462845 100644 --- a/Makefile.am +++ b/Makefile.am @@ -73,7 +73,7 @@ SVRCORE_INCLUDES = -I$(srcdir)/src/svrcore/src/ # the -U undefines these symbols - should use the corresponding DS_ ones instead - see configure.ac DS_DEFINES = -DBUILD_NUM=$(BUILDNUM) -DVENDOR="\"$(vendor)\"" -DBRAND="\"$(brand)\"" -DCAPBRAND="\"$(capbrand)\"" \ -UPACKAGE_VERSION -UPACKAGE_TARNAME -UPACKAGE_STRING -UPACKAGE_BUGREPORT -DS_INCLUDES = -I$(srcdir)/ldap/include -I$(srcdir)/ldap/servers/slapd -I$(srcdir)/include -I. $(NUNCSTANS_INCLUDES) +DS_INCLUDES = -I$(srcdir)/ldap/include -I$(srcdir)/ldap/servers/slapd -I$(srcdir)/include -I. if enable_asan @@ -134,7 +134,7 @@ AM_CFLAGS = $(DEBUG_CFLAGS) $(GCCSEC_CFLAGS) $(ASAN_CFLAGS) $(MSAN_CFLAGS) $(TSA AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(GCCSEC_CFLAGS) $(ASAN_CFLAGS) $(MSAN_CFLAGS) $(TSAN_CFLAGS) $(UBSAN_CFLAGS) # Flags for Directory Server # WARNING: This needs a clean up, because slap.h is a horrible mess and is publically exposed! -DSPLUGIN_CPPFLAGS = $(DS_DEFINES) $(DS_INCLUDES) $(PATH_DEFINES) $(SYSTEMD_DEFINES) $(NUNCSTANS_INCLUDES) @openldap_inc@ $(NSS_CFLAGS) $(NSPR_INCLUDES) $(SYSTEMD_CFLAGS) +DSPLUGIN_CPPFLAGS = $(DS_DEFINES) $(DS_INCLUDES) $(PATH_DEFINES) $(SYSTEMD_DEFINES) @openldap_inc@ $(NSS_CFLAGS) $(NSPR_INCLUDES) $(SYSTEMD_CFLAGS) # This should give access to internal headers only for tests!!! DSINTERNAL_CPPFLAGS = -I$(srcdir)/include/ldaputil # Flags for Datastructure Library @@ -202,7 +202,6 @@ endif #end hpux # If any interfaces have been removed or changed since the last public release, then set age to 0. SDS_LDFLAGS = $(NSPR_LINK) $(NSS_LINK) -lpthread -version-info 0:0:0 -NUNCSTANS_LDFLAGS = $(NSPR_LINK) $(EVENT_LINK) -version-info 1:0:1 SLAPD_LDFLAGS = -version-info 1:0:1 @@ -2368,7 +2367,6 @@ rpmbrprep: dist-bzip2 rpmroot sed -e "s/__VERSION__/$(RPM_VERSION)/" \ -e "s/__RELEASE__/$(RPM_RELEASE)/" \ -e "s/__VERSION_PREREL__/$(VERSION_PREREL)/" \ - -e "s/__NUNC_STANS_ON__/$(NUNC_STANS_ON)/" \ -e "s/__RUST_ON__/$(RUST_ON)/" \ -e "s/__CLANG_ON__/$(CLANG_ON)/" \ -e "s/__PERL_ON__/$(PERL_ON)/" \ diff --git a/configure.ac b/configure.ac index 6cf3c3a..233bc5b 100644 --- a/configure.ac +++ b/configure.ac @@ -880,7 +880,7 @@ AC_DEFINE([LDAP_ERROR_LOGGING], [1], [LDAP error logging flag]) # AC_CONFIG_FILES([ldap/admin/src/defaults.inf]) -AC_CONFIG_FILES([src/pkgconfig/dirsrv.pc src/pkgconfig/nunc-stans.pc src/pkgconfig/libsds.pc src/pkgconfig/svrcore.pc]) +AC_CONFIG_FILES([src/pkgconfig/dirsrv.pc src/pkgconfig/libsds.pc src/pkgconfig/svrcore.pc]) AC_CONFIG_FILES([Makefile rpm/389-ds-base.spec ]) diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c index fb22866..e124303 100644 --- a/ldap/servers/slapd/connection.c +++ b/ldap/servers/slapd/connection.c @@ -1712,12 +1712,6 @@ connection_threadmain() /* once the connection is readable, another thread may access conn, * so need locking from here on */ signal_listner(); - /* with nunc-stans, I see an enormous amount of time spent in the poll() in - * connection_read_operation() when the below code is enabled - not sure why - * nunc-stans makes such a huge difference - for now, just disable this code - * when using nunc-stans - it is supposed to be an optimization but turns out - * to not be the opposite with nunc-stans - */ } else { /* more data in conn - just put back on work_q - bypass poll */ bypasspollcnt++; pthread_mutex_lock(&(conn->c_mutex)); diff --git a/ldap/servers/slapd/conntable.c b/ldap/servers/slapd/conntable.c index cadcfa9..270788e 100644 --- a/ldap/servers/slapd/conntable.c +++ b/ldap/servers/slapd/conntable.c @@ -177,7 +177,6 @@ connection_table_get_connection(Connection_Table *ct, int sd) * far then `c' is not being used by any operation threads, etc. */ connection_cleanup(c); - /* NOTE - ok to do this here even if enable_nunc_stans is off */ c->c_ct = ct; /* pointer to connection table that owns this connection */ } else { /* couldn't find a Connection */ diff --git a/rpm.mk b/rpm.mk index 1b2d02e..9eb4500 100644 --- a/rpm.mk +++ b/rpm.mk @@ -8,7 +8,6 @@ PACKAGE = 389-ds-base RPM_NAME_VERSION = $(PACKAGE)-$(RPM_VERSION)$(RPM_VERSION_PREREL) NAME_VERSION = $(PACKAGE)-$(RPM_VERSION)$(VERSION_PREREL) TARBALL = $(NAME_VERSION).tar.bz2 -NUNC_STANS_ON = 1 JEMALLOC_URL ?= $(shell rpmspec -P $(RPMBUILD)/SPECS/389-ds-base.spec | awk '/^Source3:/ {print $$2}') JEMALLOC_TARBALL ?= $(shell basename "$(JEMALLOC_URL)") BUNDLE_JEMALLOC = 1 @@ -75,7 +74,6 @@ rpmroot: mkdir -p $(RPMBUILD)/SRPMS sed -e s/__VERSION__/$(RPM_VERSION)/ -e s/__RELEASE__/$(RPM_RELEASE)/ \ -e s/__VERSION_PREREL__/$(VERSION_PREREL)/ \ - -e s/__NUNC_STANS_ON__/$(NUNC_STANS_ON)/ \ -e s/__RUST_ON__/$(RUST_ON)/ \ -e s/__ASAN_ON__/$(ASAN_ON)/ \ -e s/__MSAN_ON__/$(MSAN_ON)/ \ diff --git a/src/pkgconfig/nunc-stans.pc.in b/src/pkgconfig/nunc-stans.pc.in deleted file mode 100644 index 127f330..0000000 --- a/src/pkgconfig/nunc-stans.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: Nunc Stans -Description: Thread pool based event notification library -Version: @PACKAGE_VERSION@ -Requires: nspr -Libs: -L${libdir}/@serverdir@ -lnunc-stans -Cflags: -I${includedir}/@serverincdir@