[
https://issues.apache.org/jira/browse/TS-3364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14310491#comment-14310491
]
Sudheer Vinukonda commented on TS-3364:
---------------------------------------
{code}
diff --git a/proxy/Main.cc b/proxy/Main.cc
index b976dde..1d85971 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -590,6 +590,27 @@ cmd_clear(char *cmd)
return CMD_OK;
}
+static int
+cmd_verify(char *cmd)
+{
+ fprintf(stderr, "NOTE: VERIFY\n\n");
+ if (!reloadUrlRewrite()) {
+ fprintf(stderr, "ERROR: Failed to load remap.config\n\n");
+ _exit(1); // failed to load config
+ }
+
+ fprintf(stderr, "INFO:Successfully loaded remap.config\n\n");
+
+ if (RecReadConfigFile(false) != REC_ERR_OKAY) {
+ fprintf(stderr, "ERROR: Failed to load records.config\n\n");
+ _exit(1); // failed to load config
+ }
+
+ fprintf(stderr, "INFO: Successfully loaded records.config\n\n");
+
+ _exit(0); // everything is OK
+}
+
static int cmd_help(char *cmd);
static const struct CMD
@@ -642,6 +663,12 @@ commands[] = {
"\n"
"FORMAT: clear_hostdb\n"
"\n" "Clear the entire hostdb cache. All host name resolution\n"
"information is lost.\n", cmd_clear}, {
+ "verify_config",
+ "Verify the config",
+ "\n"
+ "\n"
+ "FORMAT: verify_config\n"
+ "\n" "Load the config and verify traffic_server comes up correctly. \n",
cmd_verify}, {
"help",
"Obtain a short description of a command (e.g. 'help clear')",
"HELP\n"
@@ -1324,8 +1351,12 @@ main(int /* argc ATS_UNUSED */, char **argv)
// Local process manager
initialize_process_manager();
- // Ensure only one copy of traffic server is running
- check_lockfile();
+ if ((*command_string) && (cmd_index(command_string) ==
cmd_index("verify_config"))) {
+ fprintf (stderr, "\n\n skip lock check for %s \n\n", command_string);
+ } else {
+ // Ensure only one copy of traffic server is running
+ check_lockfile();
+ }
// Set the core limit for the process
init_core_size();
{code}
> Add configuration to control traffic_server's reaction to fatal errors
> during (re)loading the config files.
> ------------------------------------------------------------------------------------------------------------
>
> Key: TS-3364
> URL: https://issues.apache.org/jira/browse/TS-3364
> Project: Traffic Server
> Issue Type: Improvement
> Components: Configuration
> Affects Versions: 5.3.0
> Reporter: Sudheer Vinukonda
> Fix For: sometime
>
>
> Currently, traffic_server fails to initialize when it encounters fatal errors
> in loading the config files during start up. During dynamic reloading of
> config files (e.g. via traffic_line), traffic_server rejects new config and
> falls back to existing/old config (however, if there was a traffic_server
> crash/restart subsequently, that can again result into failing to initialize).
> This jira proposes to make the behavior of traffic_server when it encounters
> such fatal errors configurable via a new setting
> {{proxy.config.ignore_fatal_errors}} with the below options:
> {code}
> 0 : All errors are fatal, do not load/reload
> 1 : Ignore a bad config line, continue with the rest
> 2 : Ignore a bad config line, stop parsing the file further
> ..
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)