MCPcopy Create free account
hub / github.com/ByConity/ByConity / mainEntryClickHouseServer

Function mainEntryClickHouseServer

programs/server/Server.cpp:230–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230int mainEntryClickHouseServer(int argc, char ** argv)
231{
232 DB::Server app;
233 if (jemallocOptionEnabled("opt.background_thread"))
234 {
235 LOG_ERROR(&app.logger(),
236 "jemalloc.background_thread was requested, "
237 "however ClickHouse uses percpu_arena and background_thread most likely will not give any benefits, "
238 "and also background_thread is not compatible with ClickHouse watchdog "
239 "(that can be disabled with CLICKHOUSE_WATCHDOG_ENABLE=0)");
240 }
241
242 /// Do not fork separate process from watchdog by default
243 /// Otherwise it breaks minidump and jeprof usage
244 /// Can be overridden by environment variable (cannot use server config at this moment).
245 if (argc > 0)
246 {
247 const char * env_watchdog = getenv("CLICKHOUSE_WATCHDOG_ENABLE");
248 if (env_watchdog)
249 {
250 if (0 == strcmp(env_watchdog, "1"))
251 app.shouldSetupWatchdog(argv[0]);
252
253 /// Other values disable watchdog explicitly.
254 }
255 }
256
257 try
258 {
259 return app.run(argc, argv);
260 }
261 catch (...)
262 {
263 std::cerr << DB::getCurrentExceptionMessage(true) << "\n";
264 auto code = DB::getCurrentExceptionCode();
265 return code ? code : 1;
266 }
267}
268
269
270namespace

Callers 1

mainFunction · 0.85

Calls 7

jemallocOptionEnabledFunction · 0.85
getenvFunction · 0.85
getCurrentExceptionCodeFunction · 0.85
shouldSetupWatchdogMethod · 0.80
loggerMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected