mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-09 16:33:35 +00:00
The drain_in_progress variable here is the future that's set by the drain() operation itself. Its promise is set when the drain() finishes. The check for this future in the beginning of drain() is pointless. No two drain()-s can run in parallels because of run_with_api_lock() protection. Doing the 2nd drain after successfull 1st one is also impossible due to the _operation_mode check. The 2nd drain after _exceptioned_ (and thus incomplete) 1st one will deadlock, after this patch will try to drain for the 2nd time, but that should by ok. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com> Message-Id: <20200114094724.23876-1-xemul@scylladb.com>