mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-02 06:05:53 +00:00
There's a circular dependency: query processor needs database database owns large_data_handler and compaction_manager those two need qctx qctx owns a query_processor Respectively, the latter hidden dependency is not "tracked" by constructor arguments -- the query processor is started after the database and is deferred to be stopped before it. This works in scylla, because query processor doesn't really stop there, but in cql_test_env it's problematic as it stops everything, including the qctx. Recent database start-stop sanitation revealed this problem -- on database stop either l.d.h. or compaction manager try to start (or continue) messing with the query processor. One problem was faced immediatelly and pluged with the75e1d7easafety check inside l.d.h., but still cql_test_env tests continue suffering from use after free on stopped query processor. The fix is to partially revert the4b7846daby making the tests stop some pieces of the database (inclusing l.d.h. and compaction manager) as it used to before. In scylla this is, probably, not needed, at least now -- the database shutdown code was and still is run right before the stopping one. tests: unit(debug) Signed-off-by: Pavel Emelyanov <xemul@scylladb.com> Message-Id: <20210924080248.11764-1-xemul@scylladb.com>