summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-10-12 17:10:04 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-10-12 17:10:04 +0200
commit08fca4477cf525cada8c66d309ea1daa2eac88b2 (patch)
treee02ef89a43306ea6cbfddb129e5987d566aab419 /plugins
parent8e60b2daa653b33ac244c8cb1ae4219df9ef414c (diff)
downloadrsyslog-08fca4477cf525cada8c66d309ea1daa2eac88b2.tar.gz
rsyslog-08fca4477cf525cada8c66d309ea1daa2eac88b2.tar.xz
rsyslog-08fca4477cf525cada8c66d309ea1daa2eac88b2.zip
re-enabled input thread termination handling that does avoid thread cancellation
...where possible. This provides a more reliable mode of rsyslogd termination (canceling threads my result in not properly freed resouces and potential later hangs, even though we perform proper cancel handling in our code). This is part of an effort to reduce thread cnacellation as much as possible in rsyslog. NOTE: some comments indicated that there were problems with some code that has been re-activated. Testing did not show any issues. My current assumption is that these issues were related to some other code that has been removed/changed during the previous restructuring events. In any case, if there is a shutdown issue, one should carefully look at this change here!
Diffstat (limited to 'plugins')
-rw-r--r--plugins/imudp/imudp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c
index 735042a4..a1484e7f 100644
--- a/plugins/imudp/imudp.c
+++ b/plugins/imudp/imudp.c
@@ -336,6 +336,9 @@ rsRetVal rcvMainLoop()
nfds = epoll_wait(efd, currEvt, NUM_EPOLL_EVENTS, -1);
DBGPRINTF("imudp: epoll_wait() returned with %d fds\n", nfds);
+ if(glbl.GetGlobalInputTermState() == 1)
+ break; /* terminate input! */
+
for(i = 0 ; i < nfds ; ++i) {
processSocket(currEvt[i].data.fd, &frominetPrev, &bIsPermitted,
fromHost, fromHostFQDN, fromHostIP);
@@ -343,6 +346,9 @@ rsRetVal rcvMainLoop()
}
finalize_it:
+ if(udpEPollEvt != NULL)
+ free(udpEPollEvt);
+
RETiRet;
}
#else /* #if HAVE_EPOLL_CREATE1 */