changeset 9944:41f16633c290

6836462 nscd spinlock seen when authenticating via ldap
author Sreedhar Chalamalasetti - Sun Microsystems - Bangalore India <Sreedhar.Chalamalasetti@Sun.COM>
date Mon, 22 Jun 2009 17:48:42 -0700
parents 7fd38e9cb142
children 727d00dde35c
files usr/src/lib/libsldap/common/ns_reads.c
diffstat 1 files changed, 27 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/lib/libsldap/common/ns_reads.c	Mon Jun 22 16:43:56 2009 -0700
+++ b/usr/src/lib/libsldap/common/ns_reads.c	Mon Jun 22 17:48:42 2009 -0700
@@ -2392,17 +2392,33 @@
 						}
 					} else if ((rc == LDAP_CONNECT_ERROR ||
 					    rc == LDAP_SERVER_DOWN) &&
-					    cookie->conn_user != NULL &&
-					    cookie->reinit_on_retriable_err) {
-						/*
-						 * MT connection not usable,
-						 * close it before REINIT.
-						 * rc has already been saved
-						 * in cookie->err_rc above.
-						 */
-						__s_api_conn_mt_close(
-						    cookie->conn_user,
-						    rc, &cookie->errorp);
+					    cookie->conn_user != NULL) {
+						if (cookie->
+						    reinit_on_retriable_err) {
+							/*
+							 * MT connection not
+							 * usable, close it
+							 * before REINIT.
+							 * rc has already
+							 * been saved in
+							 * cookie->err_rc above.
+							 */
+							__s_api_conn_mt_close(
+							    cookie->conn_user,
+							    rc,
+							    &cookie->errorp);
+						} else {
+							/*
+							 * MT connection not
+							 * usable, close it in
+							 * the LDAP_ERROR state.
+							 * A retry will be done
+							 * next if allowed.
+							 */
+							cookie->err_rc = rc;
+							cookie->new_state =
+							    LDAP_ERROR;
+						}
 					}
 					break;
 				}