Commits (6)
......@@ -2,6 +2,8 @@ OpenLDAP 2.5 Change Log
OpenLDAP 2.5.13 Engineering
Fixed librewrite declaration of calloc (ITS#9841)
Fixed slapd kqueue support (ITS#9847)
Fixed slapd-mdb to check for stale readers on MDB_READERS_FULL (ITS#7165)
Build Environment
Fixed parallel builds (ITS#9840)
Contrib
......
#! /bin/sh
# From configure.ac Id: 1c372d9fe8d80795909df859a01abd486462d0a2 .
# From configure.ac Id: 15bca89511fc428731cf9ab71a9b46e37511be67 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
......@@ -16316,6 +16316,13 @@ $as_echo "no" >&6; }
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_includes_default
#ifdef HAVE_SYS_EVENT_H
#include <sys/event.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
int main(int argc, char **argv)
{
int kqfd = kqueue();
......
......@@ -1022,7 +1022,14 @@ dnl ----------------------------------------------------------------
AC_CHECK_HEADERS( sys/event.h )
if test "${ac_cv_header_sys_event_h}" = yes; then
AC_MSG_CHECKING(for kqueue system call)
AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(int argc, char **argv)
AC_RUN_IFELSE([AC_LANG_SOURCE([[$ac_includes_default
#ifdef HAVE_SYS_EVENT_H
#include <sys/event.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
int main(int argc, char **argv)
{
int kqfd = kqueue();
exit (kqfd == -1 ? 1 : 0);
......
......@@ -779,7 +779,17 @@ mdb_opinfo_get( Operation *op, struct mdb_info *mdb, int rdonly, mdb_op_info **m
return rc;
}
if ( ldap_pvt_thread_pool_getkey( ctx, mdb->mi_dbenv, &data, NULL ) ) {
int retried = 0;
retry:
rc = mdb_txn_begin( mdb->mi_dbenv, NULL, MDB_RDONLY, &moi->moi_txn );
if (rc == MDB_READERS_FULL && !retried) {
int dead;
/* if any stale readers were cleared, a slot should be available */
if (!mdb_reader_check( mdb->mi_dbenv, &dead ) && dead) {
retried = 1;
goto retry;
}
}
if (rc) {
Debug( LDAP_DEBUG_ANY, "mdb_opinfo_get: err %s(%d)\n",
mdb_strerror(rc), rc );
......
......@@ -227,11 +227,10 @@ static slap_daemon_st *slap_daemon;
slap_daemon[t].sd_kq = kqueue(); \
} while (0)
/* a kqueue fd obtained before a fork can't be used in child process.
* close it and reacquire it.
/* a kqueue fd obtained before a fork isn't inherited by child process.
* reacquire it.
*/
# define SLAP_SOCK_INIT2() do { \
close(slap_daemon[0].sd_kq); \
slap_daemon[0].sd_kq = kqueue(); \
} while (0)
......