From 0d6fd96d78e807e9996737403d331b0a219592c1 Mon Sep 17 00:00:00 2001 From: vlad shkapenyuk Date: Mon, 7 Dec 2020 18:15:45 -0500 Subject: [PATCH] Update MC to use RMR 4.4.6 Signed-off-by: vlad shkapenyuk Change-Id: I1126b2c1592037f5da2a257cd3dc2e1f4f901043 --- mc-core/Dockerfile | 4 ++-- mc-core/container-tag.yaml | 2 +- mc-core/mc/mcnib/gsprintconsole_ves.c | 16 +++++++++++----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/mc-core/Dockerfile b/mc-core/Dockerfile index 511e035..0f6fa93 100644 --- a/mc-core/Dockerfile +++ b/mc-core/Dockerfile @@ -20,7 +20,7 @@ FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:9-u18.04 AS project-b ARG STAGE_DIR -ARG RMR_VER=4.0.5 +ARG RMR_VER=4.4.6 RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMR_VER}_amd64.deb/download.deb RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMR_VER}_amd64.deb/download.deb @@ -76,7 +76,7 @@ RUN python generate_runall.py # now install the binaries and libraries into smaller docker image -FROM nexus3.o-ran-sc.org:10002/o-ran-sc/ric-app-mc-listener:1.6.0 +FROM nexus3.o-ran-sc.org:10002/o-ran-sc/ric-app-mc-listener:1.7.0 ARG STAGE_DIR diff --git a/mc-core/container-tag.yaml b/mc-core/container-tag.yaml index d6d9a34..8b6a3d0 100644 --- a/mc-core/container-tag.yaml +++ b/mc-core/container-tag.yaml @@ -1,4 +1,4 @@ --- -tag: '1.0.8' +tag: '1.0.9' # this is used by the CI jobs to tag the image it builds diff --git a/mc-core/mc/mcnib/gsprintconsole_ves.c b/mc-core/mc/mcnib/gsprintconsole_ves.c index 62a9789..33a044c 100644 --- a/mc-core/mc/mcnib/gsprintconsole_ves.c +++ b/mc-core/mc/mcnib/gsprintconsole_ves.c @@ -687,19 +687,25 @@ int main(int argc, char* argv[]) { if (rmr_port) { rmr_sbuf->mtype = rmr_mtype; // fill in the message bits - rmr_sbuf->len = strlen(linebuf) + 1; // our receiver likely wants a nice acsii-z string - memcpy(rmr_sbuf->payload, linebuf, rmr_sbuf->len); + rmr_sbuf->len = strlen(linebuf) + 1; // our receiver likely wants a nice acsii-z string + memcpy(rmr_sbuf->payload, linebuf, rmr_sbuf->len); rmr_sbuf->state = 0; rmr_sbuf = rmr_send_msg( mrc, rmr_sbuf); // send it (send returns an empty payload on success, or the original payload on fail/retry) while( rmr_sbuf->state == RMR_ERR_RETRY ) { // soft failure (device busy?) retry rmr_sbuf = rmr_send_msg( mrc, rmr_sbuf); // retry send until it's good (simple test; real programmes should do better) } - rmr_post_success_cnt++; - + if(rmr_sbuf->state != RMR_OK) { + gslog(LOG_WARNING, "rmr_send_msg() failure, strerror(errno) is %s", strerror(errno)); + rmr_post_failure_cnt++; + } else + rmr_post_success_cnt++; + if (((rmr_post_success_cnt+rmr_post_failure_cnt) % STAT_FREQUENCY) == 0) + gslog(LOG_WARNING, "%s: successful RMR posts - %llu, failed RMR posts - %llu", argv[0], rmr_post_success_cnt, rmr_post_failure_cnt); } if(curl_address==NULL){ - emit_line(); + if (!rmr_port) // if neither VES collector nor RMR is specified print to standard output + emit_line(); }else{ http_post_request_hdr(curl_endpoint, curl_url, linebuf, &http_code, curl_auth); if(http_code != 200 && http_code != 202){ -- 2.16.6