mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-25 02:50:33 +00:00
There is a race between cql connection closure and notifier registration. If a connection is closed before notification registration is complete stale pointer to the connection will remain in notification list since attempt to unregister the connection will happen to early. The fix is to move notifier unregisteration after connection's gate is closed which will ensure that there is no outstanding registration request. But this means that now a connection with closed gate can be in notifier list, so with_gate() may throw and abort a notifier loop. Fix that by replacing with_gate() by call to is_closed(); Fixes: #3355 Tests: unit(release) Message-Id: <20180412134744.GB22593@scylladb.com>