mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-29 12:47:02 +00:00
audit: assert storage ordering invariants at runtime
Abort if audit storage fails to start rather than silently running with an unaudited maintenance socket. Also assert that storage is already stopped when the audit service is destroyed, documenting the defer-stack ordering requirement. Refs SCYLLADB-1615 Refs SCYLLADB-1695
This commit is contained in:
@@ -223,6 +223,7 @@ future<> audit::stop_audit() {
|
||||
return make_ready_future<>();
|
||||
}
|
||||
return audit::audit::audit_instance().invoke_on_all([] (auto& local_audit) {
|
||||
SCYLLA_ASSERT(!local_audit._storage_running);
|
||||
return local_audit.shutdown();
|
||||
}).then([] {
|
||||
return audit::audit::audit_instance().stop();
|
||||
|
||||
4
main.cc
4
main.cc
@@ -2363,9 +2363,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
|
||||
// The table-based audit backend needs Raft (via join_cluster)
|
||||
// to create its keyspace and table.
|
||||
checkpoint(stop_signal, "starting audit storage");
|
||||
audit::audit::start_storage(*cfg).handle_exception([&] (auto&& e) {
|
||||
startlog.error("audit storage start failed: {}", e);
|
||||
}).get();
|
||||
audit::audit::start_storage(*cfg).get();
|
||||
auto audit_storage_stop = defer([] {
|
||||
audit::audit::stop_storage().get();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user