conn->c_writers++;
while ( conn->c_writers > 0 && conn->c_writing ) {
- ldap_pvt_thread_pool_idle( &connection_pool );
ldap_pvt_thread_cond_wait( &conn->c_write1_cv, &conn->c_write1_mutex );
- ldap_pvt_thread_pool_unidle( &connection_pool );
}
/* connection was closed under us */
return -1;
}
+ /* if writer is blocked and we're waiting for a pool pause,
+ * just drop this connection.
+ */
+ if ( ldap_pvt_thread_pool_pausing( &connection_pool ) > 0 ) {
+ close_reason = "writer blocked and pool pause pending";
+ goto fail;
+ }
+
/* wait for socket to be write-ready */
do_resume = 1;
conn->c_writewaiter = 1;
ldap_pvt_thread_mutex_unlock( &conn->c_write1_mutex );
- ldap_pvt_thread_pool_idle( &connection_pool );
slap_writewait_play( op );
err = slapd_wait_writer( conn->c_sd );
conn->c_writewaiter = 0;
- ldap_pvt_thread_pool_unidle( &connection_pool );
ldap_pvt_thread_mutex_lock( &conn->c_write1_mutex );
/* 0 is timeout, so we close it.
* -1 is an error, close it.