Skip to content

Commit 934926a

Browse files
committed
Add a safeguard for stand-alone mode.
1 parent a104b24 commit 934926a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cpp/server/ct-server.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ DEFINE_bool(watchdog_timeout_is_fatal, true,
9595
"Exit if the watchdog timer fires.");
9696
DEFINE_int32(num_http_server_threads, 16,
9797
"Number of threads for servicing the incoming HTTP requests.");
98+
DEFINE_bool(i_know_stand_alone_mode_can_lose_data, false,
99+
"Set this to allow stand-alone mode, even though it will lost "
100+
"submissions in the case of a crash.");
98101

99102
namespace libevent = cert_trans::libevent;
100103

@@ -461,7 +464,10 @@ int main(int argc, char* argv[]) {
461464
UrlFetcher url_fetcher(event_base.get());
462465

463466
const bool stand_alone_mode(FLAGS_etcd_host.empty());
464-
467+
if (stand_alone_mode && !FLAGS_i_know_stand_alone_mode_can_lose_data) {
468+
LOG(FATAL) << "attempted to run in stand-alone mode without the "
469+
"--i_know_stand_alone_mode_can_lose_data flag";
470+
}
465471
LOG(INFO) << "Running in "
466472
<< (stand_alone_mode ? "STAND-ALONE" : "CLUSTERED") << " mode.";
467473

0 commit comments

Comments
 (0)