diff --git a/ldms/man/ldmsctl.man b/ldms/man/ldmsctl.man index 409ea73e67..ed4f4a8df3 100644 --- a/ldms/man/ldmsctl.man +++ b/ldms/man/ldmsctl.man @@ -235,7 +235,7 @@ A unit string is one of the followings: .TP .BI interval " interval" .br -The connection retry interval. Deprecated. Please use 'reconnect'. +It is being precated. Please use 'reconnect'. .TP .BI [perm " permission"] .br @@ -263,7 +263,7 @@ attr= .br The producer name .TP -.BI [interval " interval"] +.BI [reconnect " interval"] .br The connection retry interval, which is a float followed by a unit string. If no unit string is given, the default unit is microseconds. @@ -275,6 +275,10 @@ A unit string is one of the followings: h -- hours d -- days If unspecified, the previously configured value will be used. Optional. +.TP +.BI [interval " interval"] +.br +It is being deprecated. Please use 'reconnect'. .RE .SS Start all producers matching a regular expression @@ -286,7 +290,7 @@ attr= .br A regular expression .TP -.BI [interval " interval"] +.BI [reconnect " interval"] .br The connection retry interval, which is a float followed by a unit string. If no unit string is given, the default unit is microseconds. @@ -298,6 +302,10 @@ A unit string is one of the followings: h -- hours d -- days If unspecified, the previously configured value will be used. Optional. +.TP +.BI [interval " interval"] +.br +It is being deprecated. Please use 'reconnect'. .RE .SS Stop a producer diff --git a/ldms/man/ldmsd_controller.man b/ldms/man/ldmsd_controller.man index 77bdacf60c..b809302eba 100644 --- a/ldms/man/ldmsd_controller.man +++ b/ldms/man/ldmsd_controller.man @@ -288,7 +288,7 @@ A unit string is one of the followings: .TP .BI interval " interval" .br -The connection retry interval. Deprecated. Please use 'reconnect'. +It is being deprecated. Please use 'reconnect'. .TP .BI [perm " permission"] .br @@ -323,7 +323,7 @@ attr= .br The producer name .TP -.BI [interval " interval"] +.BI [reconnect " interval"] .br The connection retry interval, which is a float followed by a unit string. If no unit string is given, the default unit is microseconds. @@ -335,6 +335,10 @@ A unit string is one of the followings: h -- hours d -- days If unspecified, the previously configured value will be used. Optional. +.TP +.BI [interval " interval"] +.br +It is being deprecated. Please use 'reconnect'. .RE .SS Start all producers matching a regular expression @@ -346,7 +350,7 @@ attr= .br A regular expression .TP -.BI [interval " interval"] +.BI [reconnect " interval"] .br The connection retry interval, which is a float followed by a unit stirng. If no unit string is given, the default unit is microseconds. @@ -358,6 +362,10 @@ A unit string is one of the followings: h -- hours d -- days If unspecified, the previously configured value will be used. Optional. +.TP +.BI [interval " interval"] +.br +It is being deprecated. Please use 'reconnect'. .RE .SS Stop a producer diff --git a/ldms/python/ldmsd/ldmsd_communicator.py b/ldms/python/ldmsd/ldmsd_communicator.py index d51546d635..b4f429091e 100644 --- a/ldms/python/ldmsd/ldmsd_communicator.py +++ b/ldms/python/ldmsd/ldmsd_communicator.py @@ -88,10 +88,10 @@ 'opt_attr' : [ 'auth', 'perm', 'interval', 'reconnect' ] }, 'prdcr_del': {'req_attr': ['name']}, 'prdcr_start': {'req_attr': ['name'], - 'opt_attr': ['interval']}, + 'opt_attr': ['interval', 'reconnect']}, 'prdcr_stop': {'req_attr': ['name']}, 'prdcr_start_regex': {'req_attr': ['regex'], - 'opt_attr': ['interval']}, + 'opt_attr': ['interval', 'reconnect']}, 'prdcr_stop_regex': {'req_attr': ['regex']}, 'prdcr_status': {'req_attr': [], 'opt_attr':['name']}, 'prdcr_set_status': {'opt_attr': ['producer', 'instance', 'schema']}, @@ -260,7 +260,6 @@ class LDMSD_Req_Attr(object): RESET = 36 DECOMPOSITION = 37 SUMMARY = 38 - RECONNECT = 39 LAST = 40 NAME_ID_MAP = {'name': NAME, @@ -304,7 +303,7 @@ class LDMSD_Req_Attr(object): 'auth': AUTH, 'decomposition' : DECOMPOSITION, 'summary' : SUMMARY, - 'reconnect' : RECONNECT, + 'reconnect' : INTERVAL, 'TERMINATING': LAST } @@ -346,7 +345,6 @@ class LDMSD_Req_Attr(object): AUTH : 'auth', DECOMPOSITION : 'decomposition', SUMMARY : 'summary', - RECONNECT : 'reconnect', LAST : 'TERMINATING' } @@ -1985,7 +1983,7 @@ def prdcr_add(self, name, ptype, xprt, host, port, reconnect, auth=None, perm=No LDMSD_Req_Attr(attr_id = LDMSD_Req_Attr.XPRT, value=xprt), LDMSD_Req_Attr(attr_id = LDMSD_Req_Attr.HOST, value=host), LDMSD_Req_Attr(attr_id = LDMSD_Req_Attr.PORT, value=str(port)), - LDMSD_Req_Attr(attr_id = LDMSD_Req_Attr.RECONNECT, value=str(reconnect)) + LDMSD_Req_Attr(attr_id = LDMSD_Req_Attr.INTERVAL, value=str(reconnect)) ] if auth: attrs.append(LDMSD_Req_Attr(attr_id=LDMSD_Req_Attr.AUTH, value=auth)) diff --git a/ldms/python/ldmsd/ldmsd_controller b/ldms/python/ldmsd/ldmsd_controller index d1048442bc..00470116cf 100755 --- a/ldms/python/ldmsd/ldmsd_controller +++ b/ldms/python/ldmsd/ldmsd_controller @@ -371,7 +371,7 @@ class LdmsdCmdParser(cmd.Cmd): print(f"Both 'interval' and 'reconnect' is given. The 'reconnect' value will be used.") else: arg['reconnect'] = arg['interval'] - print(f"'interval' is being deprecated'. Please, use 'reconnect' in the future.") + print(f"'interval' is being deprecated. Please, use 'reconnect' in the future.") rc, msg = self.comm.prdcr_add(arg['name'], arg['type'], arg['xprt'], @@ -407,12 +407,16 @@ class LdmsdCmdParser(cmd.Cmd): Start the specified producer. Parameters: name= The name of the producer - [interval=] The connection retry interval in micro-seconds. If this is not + [reconnect=] The connection retry interval in micro-seconds. If this is not specified, the previously configured value will be used. + [interval=] The same as reconnect. It is being deprecated. Please use 'reconnect'. """ arg = self.handle_args('prdcr_start', arg) if arg: - rc, msg = self.comm.prdcr_start(arg['name'], regex=False, reconnect=arg['interval']) + if arg['reconnect'] is None and arg['interval'] is not None: + arg['reconnect'] = arg['interval'] + print(f"'interval' is being deprecated. Please, use 'reconnect' in the future") + rc, msg = self.comm.prdcr_start(arg['name'], regex=False, reconnect=arg['reconnect']) if rc: print(f'Error starting prdcr {arg["name"]}: {msg}') @@ -424,12 +428,16 @@ class LdmsdCmdParser(cmd.Cmd): Start all producers matching a regular expression. Parameters: regex= A regular expression - [interval=] The connection retry interval in micro-seconds. If this is not + [reconnect=] The connection retry interval in micro-seconds. If this is not specified, the previously configured value will be used. + [interval=] The same as reconnect. It is being deprecated. Please use 'reconnect'. """ arg = self.handle_args('prdcr_start_regex', arg) if arg: - rc, msg = self.comm.prdcr_start(arg['regex'], reconnect=arg['interval']) + if arg['reconnect'] is None and arg['interval'] is not None: + arg['reconnect'] = arg['interval'] + print(f"'interval' is being deprecated. Please, use 'reconnect' in the future.") + rc, msg = self.comm.prdcr_start(arg['regex'], reconnect=arg['reconnect']) if rc: print(f'Error starting prdcr(s) with regex {arg["regex"]}: {msg}') diff --git a/ldms/src/ldmsd/ldmsctl.c b/ldms/src/ldmsd/ldmsctl.c index 3717ba7932..271f56b1ac 100644 --- a/ldms/src/ldmsd/ldmsctl.c +++ b/ldms/src/ldmsd/ldmsctl.c @@ -477,9 +477,11 @@ static void help_prdcr_start() printf( "\nStart the specified producer.\n\n" "Parameters:\n" " name= The name of the producer\n" - " [interval=] The connection retry interval in micro-seconds.\n" - " If this is not specified, the previously\n" - " configured value will be used.\n"); + " [reconnect=] The connection retry interval in micro-seconds.\n" + " If this is not specified, the previously\n" + " configured value will be used.\n" + " [interval=] The same as 'reconnect'. It is being deprecated. " + " Please use 'reconnect' in the future.\n"); } static void help_prdcr_stop() @@ -493,10 +495,12 @@ static void help_prdcr_start_regex() { printf( "\nStart all producers matching a regular expression.\n\n" "Parameters:\n\n" - " regex= A regular expression\n" - " [interval=] The connection retry interval in micro-seconds.\n" - " If this is not specified, the previously configured\n" - " value will be used.\n"); + " regex= A regular expression\n" + " [reconnect=] The connection retry interval in micro-seconds.\n" + " If this is not specified, the previously configured\n" + " value will be used.\n" + " [interval=] The same as 'reconnect'. It is being deprecated. " + " Please use 'reconnect' in the future.\n"); } static void help_prdcr_stop_regex() @@ -2593,6 +2597,13 @@ static int __handle_cmd(struct ldmsctl_ctrl *ctrl, char *cmd_str) return 0; } + if ((0 == strcmp(key.token, "prdcr_add")) || + (0 == strncmp(key.token, "prdcr_start", 11))) { + if (strstr(cmd_str, "interval")) { + printf("'interval' is begin deprecated. Please use 'reconnect' in the future.\n"); + } + } + if (cmd->action) { (void)cmd->action(ctrl, args); free(dummy); diff --git a/ldms/src/ldmsd/ldmsd_config.c b/ldms/src/ldmsd/ldmsd_config.c index 6615712ebf..eac9fc80a0 100644 --- a/ldms/src/ldmsd/ldmsd_config.c +++ b/ldms/src/ldmsd/ldmsd_config.c @@ -697,6 +697,18 @@ int __process_config_file(const char *path, int *lno, int trust, if (!off) goto next_line; + if (ldmsd_is_initialized()) { + if ((0 == strncmp(line, "prdcr_add", 9)) || + (0 == strncmp(line, "prdcr_start", 11))) { + if (strstr(line, "interval")) { + ldmsd_log(LDMSD_LWARNING, + "'interval' is begin deprecated. " + "Please use 'reconnect' with 'prdcr_add' or 'prdcr_start*' " + "in the future.\n"); + } + } + } + req_array = ldmsd_parse_config_str(line, msg_no, xprt.max_msg, ldmsd_log); if (!req_array) { rc = errno; diff --git a/ldms/src/ldmsd/ldmsd_request.c b/ldms/src/ldmsd/ldmsd_request.c index 8da75813cf..4756cfe85e 100644 --- a/ldms/src/ldmsd/ldmsd_request.c +++ b/ldms/src/ldmsd/ldmsd_request.c @@ -1533,13 +1533,7 @@ static int prdcr_add_handler(ldmsd_req_ctxt_t reqc) } attr_name = "reconnect"; - interval_s = ldmsd_req_attr_str_value_get_by_id(reqc, LDMSD_ATTR_RECONNECT); - if (!interval_s) { - interval_s = ldmsd_req_attr_str_value_get_by_id(reqc, LDMSD_ATTR_INTERVAL); - ldmsd_log(LDMSD_LWARNING, "The 'interval' in prdcr_add is " - "being deprecrated. Please use 'reconnect' instead.\n"); - } - + interval_s = ldmsd_req_attr_str_value_get_by_id(reqc, LDMSD_ATTR_INTERVAL); if (!interval_s) { goto einval; } else { @@ -1582,7 +1576,7 @@ static int prdcr_add_handler(ldmsd_req_ctxt_t reqc) goto enomem; } __dlog(DLOG_CFGOK, "prdcr_add name=%s xprt=%s host=%s port=%u type=%s " - "interval=%ld auth=%s uid=%d gid=%d perm=%o\n", + "reconnect=%ld auth=%s uid=%d gid=%d perm=%o\n", name, xprt, host, port_no, type_s, interval_us, auth ? auth : "none", (int)uid, (int)gid, (unsigned)perm); @@ -1697,7 +1691,7 @@ static int prdcr_start_handler(ldmsd_req_ctxt_t reqc) reqc->errcode = ldmsd_prdcr_start(name, interval_str, &sctxt); switch (reqc->errcode) { case 0: - __dlog(DLOG_CFGOK, "prdcr_start name=%s interval=%s\n", + __dlog(DLOG_CFGOK, "prdcr_start name=%s reconnect=%s\n", name, interval_str); break; case EBUSY: @@ -1798,7 +1792,6 @@ static int prdcr_start_regex_handler(ldmsd_req_ctxt_t reqc) } interval_str = ldmsd_req_attr_str_value_get_by_id(reqc, LDMSD_ATTR_INTERVAL); - ldmsd_req_ctxt_sec_get(reqc, &sctxt); reqc->errcode = ldmsd_prdcr_start_regex(prdcr_regex, interval_str, @@ -1806,7 +1799,7 @@ static int prdcr_start_regex_handler(ldmsd_req_ctxt_t reqc) /* on error, reqc->line_buf will be filled */ if (reqc->line_buf[0] == '\0' || reqc->line_buf[0] == '0') __dlog(DLOG_CFGOK, "prdcr_start_regex regex=%s%s%s\n", - prdcr_regex, interval_str ? " interval=" :"", + prdcr_regex, interval_str ? " reconnect=" :"", interval_str ? interval_str : ""); send_reply: diff --git a/ldms/src/ldmsd/ldmsd_request.h b/ldms/src/ldmsd/ldmsd_request.h index 500bb846d4..69d53a386d 100644 --- a/ldms/src/ldmsd/ldmsd_request.h +++ b/ldms/src/ldmsd/ldmsd_request.h @@ -226,7 +226,6 @@ enum ldmsd_request_attr { LDMSD_ATTR_RESET, LDMSD_ATTR_DECOMP, LDMSD_ATTR_SUMMARY, - LDMSD_ATTR_RECONNECT, LDMSD_ATTR_LAST, }; diff --git a/ldms/src/ldmsd/ldmsd_request_util.c b/ldms/src/ldmsd/ldmsd_request_util.c index 0b9c2511b9..56a41da44c 100644 --- a/ldms/src/ldmsd/ldmsd_request_util.c +++ b/ldms/src/ldmsd/ldmsd_request_util.c @@ -171,7 +171,6 @@ const struct req_str_id attr_str_id_table[] = { { "port", LDMSD_ATTR_PORT }, { "producer", LDMSD_ATTR_PRODUCER }, { "push", LDMSD_ATTR_PUSH }, - { "reconnect", LDMSD_ATTR_RECONNECT }, { "regex", LDMSD_ATTR_REGEX }, { "schema", LDMSD_ATTR_SCHEMA }, { "stream", LDMSD_ATTR_STREAM },