MB-25733: ewouldblock_engine: Remove disconnected connections from map
MB-25733: ewouldblock_engine: Remove disconnected connections from map

The ewouldblock_engine maintains a per-connection "inject" record, to
specify what errors (if any) should be injected for a given client
connection.

The connection_map which manages these is keyed on the address of the
Connection object (the cookie).  In long-running tests where
connections are created, disconnected and re-created, it is possible
that a cookie may be re-used. Given that ewouldblock_engine never
removes elements from the connection map, this can result in a
connection which re-uses the same address in memory having errors
injected into it unexpected, if that address is the same as a previous
connection.

The effect of this is one can see spurious failures in tests using
ewouldblock_engine.

Solve by having EWB_Engine register an ON_DISCONNECT callback with the
server, and using that to remove connections from the map when they
are disconnected.

Change-Id: I85734e957f8fbce16eeeec9eb15686a67278e947
Reviewed-on: http://review.couchbase.org/82447
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>

daverigby/kv_engine,daverigby/kv_engine,daverigby/kv_engine,daverigby/kv_engine