summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-03-25 15:11:58 -0600
committerRich Megginson <rmeggins@redhat.com>2010-03-25 17:59:54 -0600
commit48d50e8f06e0c2fd8e2541c3c239217a6b72ebbc (patch)
tree2b590c0d97017f74d04c6cc871510b9a3be5fa29
parent65e04b8d72fa0ebe8a4c8475c6bc26ac831f984f (diff)
downloadds-48d50e8f06e0c2fd8e2541c3c239217a6b72ebbc.tar.gz
ds-48d50e8f06e0c2fd8e2541c3c239217a6b72ebbc.tar.xz
ds-48d50e8f06e0c2fd8e2541c3c239217a6b72ebbc.zip
Bug 567429 - slapd didn't close connection and get into CLOSE_WAIT state
https://bugzilla.redhat.com/show_bug.cgi?id=567429 Resolves: bug 567429 Bug Description: slapd didn't close connection and get into CLOSE_WAIT state Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: The JNDI code attached to the bug uses persistent search. The connection pool code handles persistent searches differently than regular connections. The connection pool code was acquiring a reference to a conn, but was not releasing it in the persistent search case, assuming the persistent search code did not also have a reference, but it does. This caused connection_table_move_connection_out_of_active_list() to not move the connection out of the active list, and therefore available for closing, because there was an outstanding reference. The solution is for the connection pool code to release its reference. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
-rw-r--r--ldap/servers/slapd/connection.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c
index 8686d16e..bab33453 100644
--- a/ldap/servers/slapd/connection.c
+++ b/ldap/servers/slapd/connection.c
@@ -991,6 +991,13 @@ done:
}
PR_Unlock( conn->c_mutex );
+ } else { /* ps code acquires ref to conn - we need to release ours here */
+ PR_Lock( conn->c_mutex );
+ if (connection_release_nolock (conn) != 0)
+ {
+ return_value = -1;
+ }
+ PR_Unlock( conn->c_mutex );
}
return return_value;
}
@@ -2314,6 +2321,10 @@ done:
connection_release_nolock (conn);
}
PR_Unlock( conn->c_mutex );
+ } else { /* the ps code acquires a ref to the conn - we need to release ours here */
+ PR_Lock( conn->c_mutex );
+ connection_release_nolock (conn);
+ PR_Unlock( conn->c_mutex );
}
/* Since we didn't do so earlier, we need to make a replication connection readable again here */
if ( ((1 == is_timedout) || (replication_connection && !thread_turbo_flag)) && !more_data)