ldap/servers/slapd/pblock.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit 1d003452e3e01c04ae7f08f92864c28644e3d590
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Wed Nov 18 11:44:35 2015 -0800
Ticket #48338 - SimplePagedResults -- abandon could happen between the abandon check and sending results
Description: commit 390b8bd9076e8976facc0858e60985d6b4fac05c introduced
a self deadlock (see also bz1282607: 389-ds-base-1.2.11.15-67.el6_7 hang)
First phase of the following approach:
Fix design by Ludwig Krispenz and Rich Megginson (Thanks!)
Investigate the connection params used in the pblock access one by one and.
- for fields not used, either remove the access or just leave it as is
- With a big ASSERT to flag cases if the field is ever used, and a plan to
deprecate and remove the field.
- for fields with atomic access, like c_isreplication_session remove the mutex
- for filelds requiring copying, define them directly in the pblock and when
the pblock is created, populate them from the connection, the pblock access
would no longer need the c_mutex.
Removing PR_Lock(c_mutex) from slapi_pblock_get(SLAPI_CONN_CLIENTNETADDR) since
acquiring the lock is not necessary for the atomic reads. This change solves
the self deadlock.
https://fedorahosted.org/389/ticket/48338#comment:11
Reviewed by nkinder(a)redhat.com and mreynolds(a)redhat.com (Thank you, Nathan and Mark!)
(cherry picked from commit 79ca67d1fc5d50d8a9ae6b686b9564f3960f8592)
(cherry picked from commit 36245abd78f7abfed8219a5ac4a4cf50c1c0237c)
diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
index d331b57..8586428 100644
--- a/ldap/servers/slapd/pblock.c
+++ b/ldap/servers/slapd/pblock.c
@@ -252,14 +252,12 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value )
memset( value, 0, sizeof( PRNetAddr ));
break;
}
- PR_Lock( pblock->pb_conn->c_mutex );
+ /* For fields with atomic access, remove the PR_Lock(c_mutex) */
if ( pblock->pb_conn->cin_addr == NULL ) {
memset( value, 0, sizeof( PRNetAddr ));
} else {
- (*(PRNetAddr *)value) =
- *(pblock->pb_conn->cin_addr);
+ (*(PRNetAddr *)value) = *(pblock->pb_conn->cin_addr);
}
- PR_Unlock( pblock->pb_conn->c_mutex );
break;
case SLAPI_CONN_SERVERNETADDR:
if (pblock->pb_conn == NULL)
ldap/servers/slapd/pblock.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit 36245abd78f7abfed8219a5ac4a4cf50c1c0237c
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Wed Nov 18 11:44:35 2015 -0800
Ticket #48338 - SimplePagedResults -- abandon could happen between the abandon check and sending results
Description: commit 390b8bd9076e8976facc0858e60985d6b4fac05c introduced
a self deadlock (see also bz1282607: 389-ds-base-1.2.11.15-67.el6_7 hang)
First phase of the following approach:
Fix design by Ludwig Krispenz and Rich Megginson (Thanks!)
Investigate the connection params used in the pblock access one by one and.
- for fields not used, either remove the access or just leave it as is
- With a big ASSERT to flag cases if the field is ever used, and a plan to
deprecate and remove the field.
- for fields with atomic access, like c_isreplication_session remove the mutex
- for filelds requiring copying, define them directly in the pblock and when
the pblock is created, populate them from the connection, the pblock access
would no longer need the c_mutex.
Removing PR_Lock(c_mutex) from slapi_pblock_get(SLAPI_CONN_CLIENTNETADDR) since
acquiring the lock is not necessary for the atomic reads. This change solves
the self deadlock.
https://fedorahosted.org/389/ticket/48338#comment:11
Reviewed by nkinder(a)redhat.com and mreynolds(a)redhat.com (Thank you, Nathan and Mark!)
(cherry picked from commit 79ca67d1fc5d50d8a9ae6b686b9564f3960f8592)
diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
index bf57a33..f2017be 100644
--- a/ldap/servers/slapd/pblock.c
+++ b/ldap/servers/slapd/pblock.c
@@ -223,14 +223,12 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value )
memset( value, 0, sizeof( PRNetAddr ));
break;
}
- PR_Lock( pblock->pb_conn->c_mutex );
+ /* For fields with atomic access, remove the PR_Lock(c_mutex) */
if ( pblock->pb_conn->cin_addr == NULL ) {
memset( value, 0, sizeof( PRNetAddr ));
} else {
- (*(PRNetAddr *)value) =
- *(pblock->pb_conn->cin_addr);
+ (*(PRNetAddr *)value) = *(pblock->pb_conn->cin_addr);
}
- PR_Unlock( pblock->pb_conn->c_mutex );
break;
case SLAPI_CONN_SERVERNETADDR:
if (pblock->pb_conn == NULL)
ldap/servers/slapd/pblock.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit 79ca67d1fc5d50d8a9ae6b686b9564f3960f8592
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Wed Nov 18 11:44:35 2015 -0800
Ticket #48338 - SimplePagedResults -- abandon could happen between the abandon check and sending results
Description: commit 390b8bd9076e8976facc0858e60985d6b4fac05c introduced
a self deadlock (see also bz1282607: 389-ds-base-1.2.11.15-67.el6_7 hang)
First phase of the following approach:
Fix design by Ludwig Krispenz and Rich Megginson (Thanks!)
Investigate the connection params used in the pblock access one by one and.
- for fields not used, either remove the access or just leave it as is
- With a big ASSERT to flag cases if the field is ever used, and a plan to
deprecate and remove the field.
- for fields with atomic access, like c_isreplication_session remove the mutex
- for filelds requiring copying, define them directly in the pblock and when
the pblock is created, populate them from the connection, the pblock access
would no longer need the c_mutex.
Removing PR_Lock(c_mutex) from slapi_pblock_get(SLAPI_CONN_CLIENTNETADDR) since
acquiring the lock is not necessary for the atomic reads. This change solves
the self deadlock.
https://fedorahosted.org/389/ticket/48338#comment:11
Reviewed by nkinder(a)redhat.com and mreynolds(a)redhat.com (Thank you, Nathan and Mark!)
diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
index bf57a33..f2017be 100644
--- a/ldap/servers/slapd/pblock.c
+++ b/ldap/servers/slapd/pblock.c
@@ -223,14 +223,12 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value )
memset( value, 0, sizeof( PRNetAddr ));
break;
}
- PR_Lock( pblock->pb_conn->c_mutex );
+ /* For fields with atomic access, remove the PR_Lock(c_mutex) */
if ( pblock->pb_conn->cin_addr == NULL ) {
memset( value, 0, sizeof( PRNetAddr ));
} else {
- (*(PRNetAddr *)value) =
- *(pblock->pb_conn->cin_addr);
+ (*(PRNetAddr *)value) = *(pblock->pb_conn->cin_addr);
}
- PR_Unlock( pblock->pb_conn->c_mutex );
break;
case SLAPI_CONN_SERVERNETADDR:
if (pblock->pb_conn == NULL)
ldap/admin/src/scripts/50fixNsState.pl | 2 +-
ldap/admin/src/scripts/DSCreate.pm.in | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
New commits:
commit c0d35f7e107d80a3fb173dfbce001243fe78c254
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Nov 16 11:32:27 2015 -0800
Ticket #48316 - Perl-5.20.3-328: Use of literal control characters in variable names is deprecated
Description: "$^O" issues a warning "Use of literal control characters in
variable names is deprecated at /usr/lib64/dirsrv/perl/DSCreate.pm line 839."
This patch replaces "$^O" with "$Config{'osname'}".
https://fedorahosted.org/389/ticket/48316
Reviewed by rmeggins(a)redhat.com and wibrown(a)redhat.com (Thank you, Rich and William!!)
(cherry picked from commit 65362db30f55a41de1df97c8bd92047cac52ce83)
diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in
index 3ce5a73..50498fe 100644
--- a/ldap/admin/src/scripts/DSCreate.pm.in
+++ b/ldap/admin/src/scripts/DSCreate.pm.in
@@ -18,6 +18,7 @@ package DSCreate;
use DSUtil;
use Inf;
use FileConn;
+use Config;
use Sys::Hostname;
# tempfiles
@@ -836,7 +837,7 @@ sub setDefaults {
}
if (!defined($inf->{slapd}->{sasl_path})) {
- if ($ ne "linux") {
+ if ($Config{'osname'} ne "linux") {
$inf->{slapd}->{sasl_path} = "$inf->{General}->{prefix}@libdir@/sasl2";
}
}
commit 9cf628467ad33a46c6c4cb14c6535881e66bd122
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Nov 16 11:24:03 2015 -0800
Ticket #48348 - Running /usr/sbin/setup-ds.pl fails with Can't locate bigint.pm, plus two warnings
Description: bigint.pm is deprecated and no longer packaged in perl-5.22.0
on FC23. This patch replaces bigint with more basic Math::BigInt.
https://fedorahosted.org/389/ticket/48348
Reviewed by rmeggins(a)redhat.com and wibrown(a)redhat.com (Thank you, Rich and William!!)
(cherry picked from commit dfc9ad00a6bf0f8b86c4c24a01e06e3434a7ca41)
diff --git a/ldap/admin/src/scripts/50fixNsState.pl b/ldap/admin/src/scripts/50fixNsState.pl
index b331e9c..bd20708 100644
--- a/ldap/admin/src/scripts/50fixNsState.pl
+++ b/ldap/admin/src/scripts/50fixNsState.pl
@@ -4,7 +4,7 @@ use Mozilla::LDAP::Utils qw(normalizeDN);
use Mozilla::LDAP::API qw(:constant ldap_url_parse ldap_explode_dn);
use DSUtil qw(debug);
use Config;
-use bigint;
+use Math::BigInt;
# # Determine the endianness of your system
my $packfmt32 = "VVA6vCx3"; # must be 20 bytes
ldap/admin/src/scripts/50fixNsState.pl | 2 +-
ldap/admin/src/scripts/DSCreate.pm.in | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 65362db30f55a41de1df97c8bd92047cac52ce83
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Nov 16 11:32:27 2015 -0800
Ticket #48316 - Perl-5.20.3-328: Use of literal control characters in variable names is deprecated
Description: "$^O" issues a warning "Use of literal control characters in
variable names is deprecated at /usr/lib64/dirsrv/perl/DSCreate.pm line 839."
This patch replaces "$^O" with "$Config{'osname'}".
https://fedorahosted.org/389/ticket/48316
Reviewed by rmeggins(a)redhat.com and wibrown(a)redhat.com (Thank you, Rich and William!!)
diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in
index 7f272f6..ac64875 100644
--- a/ldap/admin/src/scripts/DSCreate.pm.in
+++ b/ldap/admin/src/scripts/DSCreate.pm.in
@@ -18,6 +18,7 @@ package DSCreate;
use DSUtil;
use Inf;
use FileConn;
+use Config;
use Sys::Hostname;
# tempfiles
@@ -836,7 +837,7 @@ sub setDefaults {
}
if (!defined($inf->{slapd}->{sasl_path})) {
- if ($ ne "linux") {
+ if ($Config{'osname'} ne "linux") {
$inf->{slapd}->{sasl_path} = "$inf->{General}->{prefix}@libdir@/sasl2";
}
}
commit dfc9ad00a6bf0f8b86c4c24a01e06e3434a7ca41
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Nov 16 11:24:03 2015 -0800
Ticket #48348 - Running /usr/sbin/setup-ds.pl fails with Can't locate bigint.pm, plus two warnings
Description: bigint.pm is deprecated and no longer packaged in perl-5.22.0
on FC23. This patch replaces bigint with more basic Math::BigInt.
https://fedorahosted.org/389/ticket/48348
Reviewed by rmeggins(a)redhat.com and wibrown(a)redhat.com (Thank you, Rich and William!!)
diff --git a/ldap/admin/src/scripts/50fixNsState.pl b/ldap/admin/src/scripts/50fixNsState.pl
index b331e9c..bd20708 100644
--- a/ldap/admin/src/scripts/50fixNsState.pl
+++ b/ldap/admin/src/scripts/50fixNsState.pl
@@ -4,7 +4,7 @@ use Mozilla::LDAP::Utils qw(normalizeDN);
use Mozilla::LDAP::API qw(:constant ldap_url_parse ldap_explode_dn);
use DSUtil qw(debug);
use Config;
-use bigint;
+use Math::BigInt;
# # Determine the endianness of your system
my $packfmt32 = "VVA6vCx3"; # must be 20 bytes
ldap/servers/slapd/daemon.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
New commits:
commit a4c0a9eeba031b9304d63ca05d8b9fab9ebca1b2
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Nov 5 13:08:56 2015 -0800
Ticket #48339 - Share nsslapd-threadnumber in the case nunc-stans is enabled, as well.
Description: When nunc-stans is enabled, instead of getting the
thread number from the environment variable MAX_THREADS, use the
value of config parameter nsslapd-threadnumber.
https://fedorahosted.org/389/ticket/48339
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
(cherry picked from commit ab8ed9a5ebb0d15b55d7525ed1d5dbeebd8c7563)
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index bd3bfb2..5d70647 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -1199,10 +1199,7 @@ void slapd_daemon( daemon_ports_t *ports )
#ifdef ENABLE_NUNC_STANS
if (enable_nunc_stans && !g_get_shutdown()) {
int ii;
- PRInt32 maxthreads = 3;
- if (getenv("MAX_THREADS")) {
- maxthreads = atoi(getenv("MAX_THREADS"));
- }
+ PRInt32 maxthreads = (PRInt32)config_get_threadnumber();
/* Set the nunc-stans thread pool config */
ns_thrpool_config_init(&tp_config);
ldap/servers/slapd/daemon.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
New commits:
commit b03987689c3a2477630e2a3452e64cc7759ba5f3
Author: William Brown <firstyear(a)redhat.com>
Date: Fri Nov 6 14:56:44 2015 +1000
Ticket 48311 -nunc-stans: Attempt to release connection that is not acquired
https://fedorahosted.org/389/ticket/48311
Bug Description: DS with nunc stans enabled produces lots of messages like
[13/Oct/2015:11:29:24 -0400] connection - conn=98 fd=161 Attempt to release
connection that is not acquired
FixDescription: From the original patch:
* Do not call connection_acquire_nolock() inside a PR_ASSERT call.
* Also changed other PR_ASSERTs to only be called if DEBUG is set
This additionally guarantees the return codes of these functions since we have
removed the PR_ASSERT that previously wrapped these function calls. If these
assertions fail, we log to the error log in all cases.
Author: wibrown
Review by: mreynolds, nhosoi (Thanks!)
(cherry picked from commit 49aaf98732d1e16dde3edb81272de8203aded21c)
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index 82099bc..bd3bfb2 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -1839,7 +1839,12 @@ ns_handle_closure(struct ns_job_t *job)
#ifdef DEBUG
PR_ASSERT(0 == NS_JOB_IS_THREAD(ns_job_get_type(job)));
#else
- NS_JOB_IS_THREAD(ns_job_get_type(job));
+ /* This doesn't actually confirm it's in the event loop thread, but it's a start */
+ if (NS_JOB_IS_THREAD(ns_job_get_type(job)) != 0) {
+ LDAPDebug2Args(LDAP_DEBUG_ANY, "ns_handle_closure: Attempt to close outside of event loop thread %" NSPRIu64 " for fd=%d\n",
+ c->c_connid, c->c_sd);
+ return;
+ }
#endif
PR_Lock(c->c_mutex);
connection_release_nolock_ext(c, 1); /* release ref acquired for event framework */
@@ -1896,7 +1901,14 @@ ns_connection_post_io_or_closing(Connection *conn)
#ifdef DEBUG
PR_ASSERT(0 == connection_acquire_nolock(conn));
#else
- connection_acquire_nolock(conn); /* event framework now has a reference */
+ if (connection_acquire_nolock(conn) != 0) { /* event framework now has a reference */
+ /*
+ * This has already been logged as an error in ./ldap/servers/slapd/connection.c
+ * The error occurs when we get a connection in a closing state.
+ * For now we return, but there is probably a better way to handle the error case.
+ */
+ return;
+ }
#endif
ns_add_io_timeout_job(conn->c_tp, conn->c_prfd, &tv,
NS_JOB_READ|NS_JOB_PRESERVE_FD,
@@ -1922,7 +1934,12 @@ ns_handle_pr_read_ready(struct ns_job_t *job)
#ifdef DEBUG
PR_ASSERT(0 == NS_JOB_IS_THREAD(ns_job_get_type(job)));
#else
- NS_JOB_IS_THREAD(ns_job_get_type(job));
+ /* This doesn't actually confirm it's in the event loop thread, but it's a start */
+ if (NS_JOB_IS_THREAD(ns_job_get_type(job)) != 0) {
+ LDAPDebug2Args(LDAP_DEBUG_ANY, "ns_handle_pr_read_ready: Attempt to handle read ready outside of event loop thread %" NSPRIu64 " for fd=%d\n",
+ c->c_connid, c->c_sd);
+ return;
+ }
#endif
PR_Lock(c->c_mutex);