瀏覽代碼

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 [email protected] and [email protected] (Thank you, Nathan and Mark!)
Noriko Hosoi 10 年之前
父節點
當前提交
79ca67d1fc
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      ldap/servers/slapd/pblock.c

+ 2 - 4
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)