From 0725be97733b0327f02e35610ebb3b1167423a34 Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Wed, 3 Apr 2019 07:35:38 -0600 Subject: [PATCH] drivers/syslog/syslog_stream.c: In syslog bufferedmode, avoid IOB alloc lock-up with heavy network activity. This change alters the buffered syslog logic to use 'iob_tryalloc' instead of blocking 'iob_alloc' to avoid syslog printing from getting stuck when all IOBs are depleted by network activity. An issue was seen when large incoming TCP transfer uses free IOB buffers and processing threads try to use syslog which then block at iob_alloc. --- drivers/syslog/syslog_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/syslog/syslog_stream.c b/drivers/syslog/syslog_stream.c index e3e2b1b57d..6f323be096 100644 --- a/drivers/syslog/syslog_stream.c +++ b/drivers/syslog/syslog_stream.c @@ -225,7 +225,7 @@ void syslogstream_create(FAR struct lib_syslogstream_s *stream) #ifdef CONFIG_SYSLOG_BUFFER /* Allocate an IOB */ - iob = iob_alloc(true); + iob = iob_tryalloc(true); stream->iob = iob; if (iob != NULL)