From 62f9992129187344808bd908f43d76374a8c9d3d Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Thu, 28 Jan 2021 14:03:46 +0100 Subject: [PATCH] fix valgrind complaints about swaglog old-commit-hash: 4f995b35d5d84508fda0a3d203dd8d3d35f8d2b2 --- selfdrive/common/swaglog.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selfdrive/common/swaglog.cc b/selfdrive/common/swaglog.cc index fcd207d21c..5c69c0a949 100644 --- a/selfdrive/common/swaglog.cc +++ b/selfdrive/common/swaglog.cc @@ -44,6 +44,10 @@ static void cloudlog_init() { s.ctx_j = json11::Json::object {}; s.zctx = zmq_ctx_new(); s.sock = zmq_socket(s.zctx, ZMQ_PUSH); + + int timeout = 100; // 100 ms timeout on shutdown for messages to be received by logmessaged + zmq_setsockopt(s.sock, ZMQ_LINGER, &timeout, sizeof(timeout)); + zmq_connect(s.sock, "ipc:///tmp/logmessage"); s.print_level = CLOUDLOG_WARNING;