( b->b_max_conn_pending == 0 ||
c->c_n_ops_executing < b->b_max_conn_pending ) ) {
Debug( LDAP_DEBUG_CONNS, "backend_select: "
- "selected connection %lu for client %lu msgid=%d\n",
+ "selected connection connid=%lu for client "
+ "connid=%lu msgid=%d\n",
c->c_connid, op->o_client_connid, op->o_client_msgid );
/*
LDAP_TAG_CONTROLS, BER_BV_OPTIONAL( &op->o_ctrls ) );
Debug( LDAP_DEBUG_TRACE, "request_bind: "
- "added bind from client connid=%lu to upstream connid=%lu as "
- "msgid=%d\n",
+ "added bind from client connid=%lu to upstream connid=%lu "
+ "as msgid=%d\n",
op->o_client_connid, op->o_upstream_connid, op->o_upstream_msgid );
if ( tavl_insert( &upstream->c_ops, op, operation_upstream_cmp,
avl_dup_error ) ) {
CONNECTION_LOCK(upstream);
Debug( LDAP_DEBUG_TRACE, "request_bind_as_vc: "
- "added bind from client connid=%lu to upstream connid=%lu as VC "
- "exop msgid=%d\n",
+ "added bind from client connid=%lu to upstream connid=%lu "
+ "as VC exop msgid=%d\n",
op->o_client_connid, op->o_upstream_connid, op->o_upstream_msgid );
if ( tavl_insert( &upstream->c_ops, op, operation_upstream_cmp,
avl_dup_error ) ) {
CONNECTION_LOCK(c);
if ( !c->c_live ) {
event_del( c->c_read_event );
+ Debug( LDAP_DEBUG_CONNS, "client_read_cb: "
+ "suspended read event on a dead connid=%lu\n",
+ c->c_connid );
CONNECTION_UNLOCK(c);
return;
}
Debug( LDAP_DEBUG_CONNS, "client_read_cb: "
- "connection %lu ready to read\n",
+ "connection connid=%lu ready to read\n",
c->c_connid );
ber = c->c_currentber;
ber_free( ber, 1 );
event_del( c->c_read_event );
+ Debug( LDAP_DEBUG_CONNS, "client_read_cb: "
+ "suspended read event on dying connid=%lu\n",
+ c->c_connid );
CLIENT_DESTROY(c);
return;
}
event_add( c->c_read_event, NULL );
+ Debug( LDAP_DEBUG_CONNS, "client_read_cb: "
+ "re-enabled read event on connid=%lu\n",
+ c->c_connid );
CONNECTION_UNLOCK(c);
return;
}
}
return;
}
+
event_del( c->c_read_event );
+ Debug( LDAP_DEBUG_CONNS, "client_read_cb: "
+ "suspended read event on connid=%lu\n",
+ c->c_connid );
CONNECTION_UNLOCK(c);
return;
}
event_add( c->c_read_event, NULL );
+ Debug( LDAP_DEBUG_CONNS, "handle_requests: "
+ "re-enabled read event on connid=%lu\n",
+ c->c_connid );
CLIENT_UNLOCK_OR_DESTROY(c);
return NULL;
}
ldap_pvt_thread_mutex_lock( &c->c_io_mutex );
Debug( LDAP_DEBUG_CONNS, "client_write_cb: "
- "have something to write to client %lu\n",
+ "have something to write to client connid=%lu\n",
c->c_connid );
/* We might have been beaten to flushing the data by another thread */
snprintf( c->cr_msg, sizeof(c->cr_msg),
"threads=%d smaller than minimum value 2",
c->value_int );
- Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg );
+ Debug( LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->cr_msg );
return 1;
} else if ( c->value_int > 2 * SLAP_MAX_WORKER_THREADS ) {
"(2*%d=%d); YMMV",
c->value_int, SLAP_MAX_WORKER_THREADS,
2 * SLAP_MAX_WORKER_THREADS );
- Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg );
+ Debug( LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->cr_msg );
}
if ( slapMode & SLAP_SERVER_MODE )
ldap_pvt_thread_pool_maxthreads(
snprintf( c->cr_msg, sizeof(c->cr_msg),
"threadqueues=%d smaller than minimum value 1",
c->value_int );
- Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg );
+ Debug( LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->cr_msg );
return 1;
}
if ( slapMode & SLAP_SERVER_MODE )
if ( c->value_int < 0 ) {
snprintf( c->cr_msg, sizeof(c->cr_msg),
"max_pdus_per_cycle=%d invalid", c->value_int );
- Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg );
+ Debug( LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->cr_msg );
return 1;
}
slap_conn_max_pdus_per_cycle = c->value_int;
break;
default:
- Debug( LDAP_DEBUG_ANY, "%s: unknown CFG_TYPE %d.\n",
+ Debug( LDAP_DEBUG_ANY, "%s: unknown CFG_TYPE %d\n",
c->log, c->type );
return 1;
}
c->argv[0], Conf->what );
ignored = "";
- Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: %s%s.\n",
+ Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: %s%s\n",
c->log, c->cr_msg, ignored );
return ARG_BAD_CONF;
}
}
if ( c->argc < 1 ) {
- Debug( LDAP_DEBUG_ANY, "%s: bad config line.\n", c->log );
+ Debug( LDAP_DEBUG_ANY, "%s: bad config line\n", c->log );
rc = 1;
goto done;
}
} else {
Debug( LDAP_DEBUG_ANY, "%s: unknown directive "
- "<%s> outside backend info and database definitions.\n",
+ "<%s> outside backend info and database definitions\n",
c->log, *c->argv );
rc = 1;
goto done;
{
assert( c );
Debug( LDAP_DEBUG_CONNS, "connection_destroy: "
- "destroying connection %lu.\n",
+ "destroying connection connid=%lu\n",
c->c_connid );
assert( c->c_live == 0 );
if ( s == AC_SOCKET_INVALID ) {
Debug( LDAP_DEBUG_ANY, "connection_init: "
- "init of socket fd=%ld invalid.\n",
+ "init of socket fd=%ld invalid\n",
(long)s );
return NULL;
}
if ( u == NULL || u[0] == NULL ) {
Debug( LDAP_DEBUG_ANY, "slapd_daemon_init: "
- "no urls (%s) provided.\n",
+ "no urls (%s) provided\n",
urls );
if ( u ) ldap_charray_free( u );
return -1;
if ( !c ) {
Debug( LDAP_DEBUG_ANY, "slap_listener: "
- "client_init(%ld, %s, %s) failed.\n",
+ "client_init(%ld, %s, %s) failed\n",
(long)s, peername, sl->sl_name.bv_val );
slapd_close( s );
}
*/
if ( !detach_client && race_state == SLAP_OP_FREEING_UPSTREAM ) {
Debug( LDAP_DEBUG_TRACE, "operation_destroy_from_client: "
- "op=%p lost race, increasing client refcnt c=%p\n",
- op, client );
+ "op=%p lost race, increased client refcnt connid=%lu "
+ "to refcnt=%d\n",
+ op, client->c_connid, client->c_refcnt );
CONNECTION_LOCK(client);
} else {
Debug( LDAP_DEBUG_TRACE, "operation_destroy_from_client: "
*/
upstream->c_refcnt--;
Debug( LDAP_DEBUG_TRACE, "operation_destroy_from_client: "
- "op=%p other side lost race with us\n",
- op );
+ "op=%p other side lost race with us, upstream connid=%lu\n",
+ op, upstream->c_connid );
}
ldap_pvt_thread_mutex_unlock( &op->o_mutex );
*/
if ( !detach_upstream && race_state == SLAP_OP_FREEING_CLIENT ) {
Debug( LDAP_DEBUG_TRACE, "operation_destroy_from_upstream: "
- "op=%p lost race, increasing upstream refcnt c=%p\n",
- op, upstream );
+ "op=%p lost race, increased upstream refcnt connid=%lu "
+ "to refcnt=%d\n",
+ op, upstream->c_connid, upstream->c_refcnt );
CONNECTION_LOCK(upstream);
} else {
Debug( LDAP_DEBUG_TRACE, "operation_destroy_from_upstream: "
*/
client->c_refcnt--;
Debug( LDAP_DEBUG_TRACE, "operation_destroy_from_upstream: "
- "op=%p other side lost race with us\n",
- op );
+ "op=%p other side lost race with us, client connid=%lu\n",
+ op, client->c_connid );
}
ldap_pvt_thread_mutex_unlock( &op->o_mutex );
rc = tavl_insert( &c->c_ops, op, operation_client_cmp, avl_dup_error );
if ( rc ) {
Debug( LDAP_DEBUG_PACKETS, "operation_init: "
- "several operations with same msgid=%d in-flight from client "
- "%lu\n",
+ "several operations with same msgid=%d in-flight "
+ "from client connid=%lu\n",
op->o_client_msgid, op->o_client_connid );
goto fail;
}
request = tavl_find( c->c_ops, &needle, operation_client_cmp );
if ( !request ) {
+ Debug( LDAP_DEBUG_TRACE, "request_abandon: "
+ "connid=%lu msgid=%d requests abandon of an operation "
+ "msgid=%d not being processed anymore\n",
+ c->c_connid, op->o_client_msgid, needle.o_client_msgid );
goto done;
}
+ Debug( LDAP_DEBUG_TRACE, "request_abandon: "
+ "connid=%lu msgid=%d abandoning %s msgid=%d\n",
+ c->c_connid, op->o_client_msgid, slap_msgtype2str( request->o_tag ),
+ needle.o_client_msgid );
CONNECTION_UNLOCK_INCREF(c);
operation_abandon( request );
int found;
Debug( LDAP_DEBUG_TRACE, "operation_send_reject: "
- "rejecting %s from client %lu with message: \"%s\"\n",
+ "rejecting %s from client connid=%lu with message: \"%s\"\n",
slap_msgtype2str( op->o_tag ), op->o_client_connid, msg );
ldap_pvt_thread_mutex_lock( &operation_mutex );
* client is dead, it must have been the upstream */
assert( c );
CONNECTION_LOCK(c);
+ Debug( LDAP_DEBUG_TRACE, "operation_send_reject: "
+ "not sending msgid=%d, client connid=%lu is dead\n",
+ op->o_client_msgid, op->o_client_connid );
ldap_pvt_thread_mutex_unlock( &operation_mutex );
operation_destroy_from_upstream( op );
UPSTREAM_UNLOCK_OR_DESTROY(c);
found = ( tavl_delete( &c->c_ops, op, operation_client_cmp ) == op );
if ( !found && !send_anyway ) {
+ Debug( LDAP_DEBUG_TRACE, "operation_send_reject: "
+ "msgid=%d not scheduled for client connid=%lu anymore, "
+ "not sending\n",
+ op->o_client_msgid, c->c_connid );
goto done;
}
}
Debug( LDAP_DEBUG_CONNS, "forward_response: "
- "%s to client %lu request #%d\n",
+ "%s to client connid=%lu request msgid=%d\n",
slap_msgtype2str( response_tag ), op->o_client_connid,
op->o_client_msgid );
int rc;
Debug( LDAP_DEBUG_CONNS, "forward_final_response: "
- "finishing up with request #%d for client %lu\n",
- op->o_client_msgid, op->o_client_connid );
+ "connid=%lu msgid=%d finishing up with a request for "
+ "client connid=%lu\n",
+ op->o_upstream_connid, op->o_upstream_msgid, op->o_client_connid );
rc = forward_response( op, ber );
CONNECTION_LOCK_DECREF(op->o_upstream);
operation_destroy_from_upstream( op );
}
Debug( LDAP_DEBUG_CONNS, "handle_bind_response: "
- "received response for bind request by client %lu, result=%d\n",
+ "received response for bind request by client connid=%lu, "
+ "result=%d\n",
op->o_client_connid, result );
CONNECTION_LOCK(c);
CONNECTION_LOCK(upstream);
b = (Backend *)upstream->c_private;
- Debug( LDAP_DEBUG_ANY, "VC extended operation not supported on backend %s\n",
+ Debug( LDAP_DEBUG_ANY, "handle_vc_bind_response: "
+ "VC extended operation not supported on backend %s\n",
b->b_uri.bv_val );
CONNECTION_UNLOCK(upstream);
}
CONNECTION_LOCK(c);
Debug( LDAP_DEBUG_CONNS, "handle_vc_bind_response: "
- "received response for bind request by client %lu, result=%d\n",
+ "received response for bind request by client connid=%lu, "
+ "result=%d\n",
c->c_connid, result );
if ( tag == LDAP_TAG_EXOP_VERIFY_CREDENTIALS_COOKIE ) {
c->c_state = SLAP_C_CLOSING;
Debug( LDAP_DEBUG_CONNS, "handle_unsolicited: "
- "teardown for upstream connection %lu\n",
+ "teardown for upstream connection connid=%lu\n",
c->c_connid );
UPSTREAM_DESTROY(c);
}
if ( op ) {
Debug( LDAP_DEBUG_TRACE, "handle_one_response: "
- "upstream=%lu, processing response for client connid=%lu, "
- "msgid=%d\n",
+ "upstream connid=%lu, processing response for "
+ "client connid=%lu, msgid=%d\n",
c->c_connid, op->o_client_connid, op->o_client_msgid );
} else {
tag = ber_peek_tag( ber, &len );
- Debug( LDAP_DEBUG_TRACE, "handle_one_response: "
- "upstream=%lu, %s, msgid=%d not for a pending operation\n",
+ Debug( LDAP_DEBUG_STATS2, "handle_one_response: "
+ "upstream connid=%lu, %s, msgid=%d not for a pending "
+ "operation\n",
c->c_connid, slap_msgtype2str( tag ), needle.o_upstream_msgid );
}
fail:
if ( rc ) {
- Debug( LDAP_DEBUG_ANY, "handle_one_response: "
- "error on processing a response on upstream connection %ld\n",
- c->c_connid );
+ Debug( LDAP_DEBUG_STATS, "handle_one_response: "
+ "error on processing a response (%s) on upstream connection "
+ "connid=%ld, tag=%lx\n",
+ slap_msgtype2str( tag ), c->c_connid, tag );
UPSTREAM_DESTROY(c);
}
/* We leave the connection locked */
}
event_add( c->c_read_event, NULL );
+ Debug( LDAP_DEBUG_CONNS, "handle_responses: "
+ "re-enabled read event on connid=%lu\n",
+ c->c_connid );
UPSTREAM_UNLOCK_OR_DESTROY(c);
return NULL;
}
CONNECTION_LOCK(c);
if ( !c->c_live ) {
event_del( c->c_read_event );
+ Debug( LDAP_DEBUG_CONNS, "upstream_read_cb: "
+ "suspended read event on a dead connid=%lu\n",
+ c->c_connid );
CONNECTION_UNLOCK(c);
return;
}
Debug( LDAP_DEBUG_CONNS, "upstream_read_cb: "
- "connection %lu ready to read\n",
+ "connection connid=%lu ready to read\n",
c->c_connid );
ber = c->c_currentber;
ber_free( ber, 1 );
event_del( c->c_read_event );
+ Debug( LDAP_DEBUG_CONNS, "upstream_read_cb: "
+ "suspended read event on dying connid=%lu\n",
+ c->c_connid );
UPSTREAM_DESTROY(c);
return;
}
event_add( c->c_read_event, NULL );
+ Debug( LDAP_DEBUG_CONNS, "upstream_read_cb: "
+ "re-enabled read event on connid=%lu\n",
+ c->c_connid );
CONNECTION_UNLOCK(c);
return;
}
evutil_socket_t s = c->c_fd;
Debug( LDAP_DEBUG_CONNS, "upstream_finish: "
- "connection %lu is ready for use\n",
+ "connection connid=%lu is ready for use\n",
c->c_connid );
base = slap_get_base( s );
CONNECTION_LOCK(c);
Debug( LDAP_DEBUG_CONNS, "upstream_bind_cb: "
- "connection %lu ready to read\n",
+ "connection connid=%lu ready to read\n",
c->c_connid );
ber = c->c_currentber;
fail:
event_del( c->c_read_event );
+ Debug( LDAP_DEBUG_CONNS, "upstream_bind_cb: "
+ "suspended read event on dying connid=%lu\n",
+ c->c_connid );
ber_free( ber, 1 );
UPSTREAM_DESTROY(c);
}
ldap_pvt_thread_mutex_lock( &c->c_io_mutex );
Debug( LDAP_DEBUG_CONNS, "upstream_write_cb: "
- "have something to write to upstream %lu\n",
+ "have something to write to upstream connid=%lu\n",
c->c_connid );
/* We might have been beaten to flushing the data by another thread */
long freed, executing;
Debug( LDAP_DEBUG_CONNS, "upstream_destroy: "
- "freeing connection %lu\n",
+ "freeing connection connid=%lu\n",
c->c_connid );
c->c_state = SLAP_C_INVALID;