#47383 connections attribute in cn=snmp,cn=monitor is counted twice
Closed: Fixed None Opened 6 years ago by nkinder.

Attribute "connections" in cn=snmp,cn=monitor should keep "Number of currently
connected clients", as described in ldap/servers/slapd/slap.h
Because of error in program logic, it is incremented twice - in functions
disconnect_server_nomutex() and connection_reset(). The value is never
decremented.

How reproducible:
ldapsearch -b 'cn=monitor' connections connectionseq currentconnections
...

monitor

dn: cn=monitor
currentconnections: 46

counters, monitor

dn: cn=counters,cn=monitor

snmp, monitor

dn: cn=snmp,cn=monitor
connections: 116016
connectionseq: 58031

Note that 2 * 58031 - 116016 = 46

Actual results:
connections: 116016

Expected results:
connections: 46

Additional info:

Problem is in function:
void disconnect_server_nomutex( Connection *conn, PRUint64 opconnid, int opid,
PRErrorCode reason, PRInt32 error )
where is called:
slapi_counter_increment(g_get_global_snmp_vars()->ops_tbl.dsConnections);
instead of:
slapi_counter_decrement(g_get_global_snmp_vars()->ops_tbl.dsConnections);

Attribute "currentconnections" doesn't suffer this problem because it's value
is taken directly from connection table.


git merge ticket47383
Updating 4a0199b..202c983
Fast-forward
ldap/servers/slapd/connection.c | 131 ++++++++++++++++++++-------------------
1 files changed, 66 insertions(+), 65 deletions(-)

git push origin master

4a0199b..202c983 master -> master

commit 202c983

1.3.1

ae60af1..17d9dc5  389-ds-base-1.3.1 -> 389-ds-base-1.3.1

1.3.0

136761c..fcce22c  389-ds-base-1.3.0 -> 389-ds-base-1.3.0

1.2.11

8212d48..accea11  389-ds-base-1.2.11 -> 389-ds-base-1.2.11

Metadata Update from @mreynolds:
- Issue assigned to mreynolds
- Issue set to the milestone: 1.2.11.22

2 years ago

Login to comment on this ticket.

Metadata