From b39dd111a4403a2cd408133601e06af46010c749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= Date: Tue, 9 Jan 2018 11:29:55 +0100 Subject: [PATCH] Update alpine linux base to 3.7, and dependencies Runtime libraries - librdkafka (0.9.5-r0 -> 0.11.1-r1) * Use of rd_kafka_last_error() instead of global errno * Defaulting `queue.buffering.max.ms` to 1000ms * Applying topics properties to kafka handler - musl (1.1.16-r14 -> 1.1.18-r2) Devel tools - libatomic (6.3.0-r4 -> 6.4.0-r5) - gcc (6.3.0-r4 -> 6.4.0-r5) - fortify-headers (0.8-r0 -> 0.9-r0) - expat (2.2.0-r1 -> 2.2.5-r0) - gdb (7.12.1-r1 -> 8.0.1-r3) - cgdb (0.7.0-r0 -> 0.7.0-r1) - expat-dev (2.2.0-r1 -> 2.2.5-r0) - guile (2.0.13-r0 -> 2.0.14-r0) - libbz2 (1.0.6-r5 -> 1.0.6-r6) - libarchive-tools (3.3.1-r2 -> 3.3.2-r2) - net-snmp-libs (5.7.3-r8 -> 5.7.3-r10) - python3 (3.6.1-r3 -> 3.6.3-r9) - valgrind (3.12.0-r1) --- docker/Dockerfile.m4 | 7 ++----- src/main.c | 6 ++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docker/Dockerfile.m4 b/docker/Dockerfile.m4 index 808b77c..2a5c71c 100644 --- a/docker/Dockerfile.m4 +++ b/docker/Dockerfile.m4 @@ -1,4 +1,4 @@ -FROM alpine:3.6 +FROM alpine:3.7 # envsubst (gettext is very big! install only binary & dependency) RUN apk add --no-cache libintl gettext && \ @@ -6,10 +6,7 @@ RUN apk add --no-cache libintl gettext && \ apk del gettext # Common C runtime libraries -RUN apk add --no-cache librdkafka jansson zlib - -# n2k libraries -RUN apk add --no-cache yajl libmicrohttpd libev +RUN apk add --no-cache librdkafka zlib # ca-certificates: for wget bootstrapping # ncurses - expat: deps for xml-coreutils diff --git a/src/main.c b/src/main.c index 2f30f33..60195dc 100644 --- a/src/main.c +++ b/src/main.c @@ -553,8 +553,7 @@ static int worker_process_sensor_send_array(struct _worker_info *worker_info, rdlog(LOG_ERR, "[Kafka] Cannot produce kafka message: " "%s", - rd_kafka_err2str(rd_kafka_errno2err( - errno))); + rd_kafka_err2str(rd_kafka_last_error())); } } /* if kafka */ @@ -762,6 +761,9 @@ int main(int argc, char *argv[]) { worker_info.rk_conf = rd_kafka_conf_new(); worker_info.rkt_conf = rd_kafka_topic_conf_new(); + // Default to librdkafka pre-0.11 behavior: + rd_kafka_conf_set(worker_info.rk_conf, "linger.ms", "1000", NULL, 0); + pthread_t *pd_thread = NULL; rd_fifoq_t queue; sensor_queue_init(&queue);