mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 18:20:07 +01:00
Bug#11754011: 45546: START WINDOWS SERVICE, THEN EXECUTE WHAT IS NEEDED.
Added a global read-only option slow-start-timeout to control the Windows service control manager's service start timeout, that was currently hard-coded to be 15 seconds. The default of the new option is 15 seconds. The timeout can also be set to 0 (to mean no timeout applicable).
This commit is contained in:
parent
0ff2a90b8a
commit
0906ae7741
3 changed files with 35 additions and 1 deletions
|
@ -368,6 +368,9 @@ my_bool locked_in_memory;
|
||||||
bool opt_using_transactions;
|
bool opt_using_transactions;
|
||||||
bool volatile abort_loop;
|
bool volatile abort_loop;
|
||||||
bool volatile shutdown_in_progress;
|
bool volatile shutdown_in_progress;
|
||||||
|
#if defined(_WIN32) && !defined(EMBEDDED_LIBRARY)
|
||||||
|
ulong slow_start_timeout;
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
True if the bootstrap thread is running. Protected by LOCK_thread_count,
|
True if the bootstrap thread is running. Protected by LOCK_thread_count,
|
||||||
just like thread_count.
|
just like thread_count.
|
||||||
|
@ -4369,6 +4372,14 @@ int mysqld_main(int argc, char **argv)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
The subsequent calls may take a long time : e.g. innodb log read.
|
||||||
|
Thus set the long running service control manager timeout
|
||||||
|
*/
|
||||||
|
#if defined(_WIN32) && !defined(EMBEDDED_LIBRARY)
|
||||||
|
Service.SetSlowStarting(slow_start_timeout);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (init_server_components())
|
if (init_server_components())
|
||||||
unireg_abort(1);
|
unireg_abort(1);
|
||||||
|
|
||||||
|
@ -5883,6 +5894,13 @@ struct my_option my_long_options[]=
|
||||||
"Don't give threads different priorities. This option is deprecated "
|
"Don't give threads different priorities. This option is deprecated "
|
||||||
"because it has no effect; the implied behavior is already the default.",
|
"because it has no effect; the implied behavior is already the default.",
|
||||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
|
#if defined(_WIN32) && !defined(EMBEDDED_LIBRARY)
|
||||||
|
{"slow-start-timeout", 0,
|
||||||
|
"Maximum number of milliseconds that the service control manager should wait "
|
||||||
|
"before trying to kill the windows service during startup"
|
||||||
|
"(Default: 15000).", &slow_start_timeout, &slow_start_timeout, 0,
|
||||||
|
GET_ULONG, REQUIRED_ARG, 15000, 0, 0, 0, 0, 0},
|
||||||
|
#endif
|
||||||
#ifdef HAVE_REPLICATION
|
#ifdef HAVE_REPLICATION
|
||||||
{"sporadic-binlog-dump-fail", 0,
|
{"sporadic-binlog-dump-fail", 0,
|
||||||
"Option used by mysql-test for debugging and testing of replication.",
|
"Option used by mysql-test for debugging and testing of replication.",
|
||||||
|
|
|
@ -276,7 +276,13 @@ error:
|
||||||
void NTService::SetRunning()
|
void NTService::SetRunning()
|
||||||
{
|
{
|
||||||
if (pService)
|
if (pService)
|
||||||
pService->SetStatus(SERVICE_RUNNING,NO_ERROR, 0, 0, 0);
|
pService->SetStatus(SERVICE_RUNNING, NO_ERROR, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NTService::SetSlowStarting(unsigned long timeout)
|
||||||
|
{
|
||||||
|
if (pService)
|
||||||
|
pService->SetStatus(SERVICE_START_PENDING,NO_ERROR, 0, 0, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,16 @@ class NTService
|
||||||
*/
|
*/
|
||||||
void SetRunning(void);
|
void SetRunning(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets a timeout after which SCM will abort service startup if SetRunning()
|
||||||
|
was not called or the timeout was not extended with another call to
|
||||||
|
SetSlowStarting(). Should be called when static initialization completes,
|
||||||
|
and the variable initialization part begins
|
||||||
|
|
||||||
|
@arg timeout the timeout to pass to the SCM (in milliseconds)
|
||||||
|
*/
|
||||||
|
void SetSlowStarting(unsigned long timeout);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Stop() is to be called by the application to stop
|
Stop() is to be called by the application to stop
|
||||||
the service
|
the service
|
||||||
|
|
Loading…
Add table
Reference in a new issue