ovsdb-server: Fix a reference count leak bug
authorandy zhou <azhou@ovn.org>
Mon, 7 Mar 2016 23:44:34 +0000 (15:44 -0800)
committerAndy Zhou <azhou@ovn.org>
Tue, 8 Mar 2016 19:20:19 +0000 (11:20 -0800)
commitf76def2592cc5cb449a3360430ee9cc0f208765d
treed396edb208291957de84c40774f63a01456690aa
parent1b4993133f281a9b181aedc9f56930ab4b4de65a
ovsdb-server: Fix a reference count leak bug

When destroying an ovsdb_jsonrpc_monitor, the jsonrpc monitor still
holds a reference count to the monitors 'changes' indexed with
'unflushed' transaction id.  The bug is that the reference count was
not decremented as it should in the code path.

The bug caused 'changes' that have been flushed to all jsonrpc
clients to linger around unnecessarily, occupying increasingly
large amount of memory. See "Reported-at" URL for more details.

This bug is tricky to find since the memory is not leaked; they will
eventually be freed when monitors are destroyed.

Reported-by: Lei Huang <huang.f.lei@gmail.com>
Reported-at: http://openvswitch.org/pipermail/dev/2016-March/067274.html
Signed-off-by: Andy Zhou <azhou@ovn.org>
Tested-by: Han Zhou <zhouhan@gmail.com>
Acked-by: Han Zhou <zhouhan@gmail.com>
Acked-by: Liran Schour <lirans@il.ibm.com>
AUTHORS
ovsdb/jsonrpc-server.c
ovsdb/monitor.c
ovsdb/monitor.h