From 95df8a1ec801dff67f4141caf311c8255e88b62f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Mon, 26 Jun 2017 16:18:03 +0100 Subject: [PATCH] Adjust backend operation counting --- servers/lloadd/operation.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/servers/lloadd/operation.c b/servers/lloadd/operation.c index 6bb0836af6..f7fd24da9f 100644 --- a/servers/lloadd/operation.c +++ b/servers/lloadd/operation.c @@ -755,10 +755,18 @@ request_process( Connection *client, Operation *op ) fail: if ( upstream ) { + Backend *b; + ldap_pvt_thread_mutex_unlock( &upstream->c_io_mutex ); CONNECTION_LOCK_DECREF(upstream); upstream->c_n_ops_executing--; + b = (Backend *)upstream->c_private; UPSTREAM_UNLOCK_OR_DESTROY(upstream); + + ldap_pvt_thread_mutex_lock( &b->b_mutex ); + b->b_n_ops_executing--; + ldap_pvt_thread_mutex_unlock( &b->b_mutex ); + operation_send_reject( op, LDAP_OTHER, "internal error", 0 ); } CONNECTION_LOCK_DECREF(client);