Skip to content

Commit ad1fd21

Browse files
committed
imtcp: major multithreading and performance improvements
This commit significantly enhances imtcp by introducing a fully functional worker thread pool, enabling true multi-threaded processing for better scalability under high loads. This is particularly beneficial when using TLS connections. Notable changes: - Implemented a complete worker pool for imtcp. - Introduced the `workerthreads` config parameter for tuning concurrency. - Improved epoll efficiency by enabling edge-triggered mode. - Added starvation handling via `starvationProtection.maxReads`. - Refactored session accept logic and optimized network object handling. - Removed an obsolete network driver layer for event notification. - Fixed multiple issues related to message timing, EPOLLERR handling, and tests. - Improved performance in poll() mode by reducing redundant allocations. - Introduced new CI tests for imtcp without epoll. - Allowed disabling imtcp tests via a new configure switch. - Added new impstats counters for worker thread pool statistics. Details: - The worker pool replaces an outdated experimental implementation. - If `workerthreads=1`, no worker pool is created to minimize context switches. - Moves worker pool variables inside `tcpsrv` instance to prevent conflicts. - Extracts session `accept()` logic into a dedicated function for clarity. - Fixes message ordering inconsistencies in multi-threaded scenarios. - Properly handles `EPOLLERR` notifications to improve error resilience. - Optimizes poll() mode by avoiding unnecessary reallocation of file descriptors. - Replaces the old network driver layer for event notification with a streamlined solution. - Now uses **conditional compilation** to select the best method (epoll or poll) at build time. - This significantly reduces code complexity, improves maintainability, and boosts performance. - The previous "thread pool" was a rough experiment that did not perform significantly better than single-threaded mode. - The **new implementation** allows multiple worker threads on platforms with `epoll`. - On non-epoll systems, an optimized **poll() based single-threaded approach** is used, which is expected to perform better than the old "thread pool." - Adds `pthread_setname_np` only when available to improve portability. - Fixes test cases that assumed strict message timing, which was unreliable. - Reduces test parallelism for TSAN CI runs to prevent resource exhaustion. - Moves a test case to `imdiag` to ensure stable execution. - Provides a new CI environment to verify `imtcp` behavior without epoll. - Introduces `--enable-imtcp-tests` configure switch for test flexibility. - Improves debug logging and adds better error handling for worker pool startup. New configuration parameters: - `workerthreads`: Defines the number of worker threads for imtcp. If set to 1, no worker pool is created. - `starvationProtection.maxReads`: Defines the maximum number of consecutive reads a worker can perform before being interrupted to allow other sessions to be processed. New impstats counters (emitted only when `workerthreads > 1`): - `runs`: Number of times the worker thread has been invoked. - `read`: Number of read calls performed by the worker. For TLS, this includes read/write calls. - `accept`: Number of `accept()` calls handled by the worker. - `starvation_protect`: Number of times a socket was sent back to the queue due to reaching the maximum number of consecutive requests, ensuring fair scheduling of sessions. These changes significantly enhance rsyslog’s TCP handling performance and stability, particularly in high-volume environments. Closes rsyslog#5529, rsyslog#5532, rsyslog#5578, rsyslog#5580.
1 parent 0473577 commit ad1fd21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1235
-2276
lines changed

.github/workflows/run_checks.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
fail-fast: false
3737
matrix:
3838
config: [centos_7, centos_8, debian_10, debian_11,
39+
ubuntu_24_imtcp_no_epoll,
3940
fedora_35, fedora_36,
4041
ubuntu_18, ubuntu_20, ubuntu_24,
4142
ubuntu_22_san, ubuntu_24_tsan, ubuntu_22_codecov, ubuntu_22_distcheck,
@@ -79,6 +80,21 @@ jobs:
7980
export RSYSLOG_CONFIGURE_OPTIONS_EXTRA="--disable-elasticsearch-tests --disable-kafka-tests \
8081
--without-valgrind-testbench --enable-imdtls --enable-omdtls"
8182
;;
83+
'ubuntu_24_imtcp_no_epoll')
84+
# This check tests if imtcp runs in poll (select) mode. We have only slow CI runners for
85+
# platforms where this is the case, thus we do a quick run on ubuntu where we also have all
86+
# thread and memory debuggers available.
87+
export RSYSLOG_DEV_CONTAINER='rsyslog/rsyslog_dev_base_ubuntu:24.04'
88+
export CI_VALGRIND_SUPPRESSIONS="ubuntu22.04.supp"
89+
# Note: we completely override the container configure options here!
90+
export RSYSLOG_CONFIGURE_OPTIONS_OVERRIDE="--enable-testbench --enable-omstdout \
91+
--enable-imdiag --disable-imtcp-epoll --enable-imtcp-tests\
92+
--disable-impstats --disable-imfile --disable-imfile-tests \
93+
--disable-fmhttp --enable-valgrind --enable-valgrind-testbench \
94+
--disable-helgrind --disable-default-tests --disable-kafka-tests \
95+
--disable-omkafka --disable-imkafka \
96+
--enable-gnutls --enable-openssl --enable-gnutls-tests"
97+
;;
8298
'fedora_35')
8399
export RSYSLOG_DEV_CONTAINER='rsyslog/rsyslog_dev_base_fedora:35'
84100
export RSYSLOG_CONFIGURE_OPTIONS_EXTRA="--disable-elasticsearch-tests \
@@ -130,7 +146,7 @@ jobs:
130146
;;
131147
'ubuntu_24_tsan')
132148
export RSYSLOG_DEV_CONTAINER='rsyslog/rsyslog_dev_base_ubuntu:24.04'
133-
export CI_MAKE_CHECK_OPT='-j3' # This is CPU-heavy due to tsan, so we need less concurrency to prevent flakes
149+
export CI_MAKE_CHECK_OPT='-j2' # This is CPU-heavy due to tsan, so we need less concurrency to prevent flakes
134150
export CI_VALGRIND_SUPPRESSIONS="ubuntu22.04.supp"
135151
export CI_SANITIZE_BLACKLIST='tests/tsan.supp'
136152
export CC='clang'
@@ -169,7 +185,7 @@ jobs:
169185
export RSYSLOG_CONFIGURE_OPTIONS_OVERRIDE="--enable-testbench --enable-omstdout \
170186
--enable-imdiag --disable-impstats --enable-imfile --disable-imfile-tests \
171187
--disable-fmhttp --enable-valgrind --enable-valgrind-testbench \
172-
--disable-helgrind --disable-default-tests --enable-kafka-tests \
188+
--disable-helgrind --disable-default-tests --disable-imtcp-tests --enable-kafka-tests \
173189
--enable-omkafka --enable-gnutls --disable-gnutls-tests --enable-imkafka"
174190
;;
175191
'elasticsearch')
@@ -180,7 +196,7 @@ jobs:
180196
export ABORT_ALL_ON_TEST_FAIL='NO'
181197
export RSYSLOG_CONFIGURE_OPTIONS_OVERRIDE="--enable-testbench --enable-omstdout \
182198
--enable-imdiag --enable-impstats --enable-imfile --disable-imfile-tests \
183-
--disable-fmhttp --enable-valgrind --disable-default-tests \
199+
--disable-fmhttp --enable-valgrind --disable-default-tests --disable-imtcp-tests \
184200
--enable-elasticsearch-tests --enable-elasticsearch"
185201
export CI_MAKE_OPT='-j20'
186202
export CI_MAKE_CHECK_OPT='-j8'

configure.ac

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ AC_TYPE_SIGNAL
233233
AC_FUNC_STAT
234234
AC_FUNC_STRERROR_R
235235
AC_FUNC_VPRINTF
236-
AC_CHECK_FUNCS([flock recvmmsg basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setsid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync syscall lseek64 asprintf close_range])
236+
AC_CHECK_FUNCS([flock recvmmsg basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setsid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync syscall lseek64 asprintf close_range pthread_setname_np])
237237
AC_CHECK_FUNC([setns], [AC_DEFINE([HAVE_SETNS], [1], [Define if setns exists.])])
238238
AC_CHECK_TYPES([off64_t])
239239

@@ -1792,8 +1792,6 @@ AM_CONDITIONAL(ENABLE_LIBFAKETIME, test "x${enable_libfaketime}" = "xyes")
17921792
# are those tests that do not need a special configure option. There are
17931793
# some situations where we really want to turn them of so that we can
17941794
# run tests only for a specific component (e.g. ElasticSearch).
1795-
# This also enables us to do some parallel testing even while the
1796-
# testbench is not yet able to support make -j check
17971795
AC_ARG_ENABLE(default-tests,
17981796
[AS_HELP_STRING([--enable-default-tests],[default-tests enabled @<:@default=yes@:>@])],
17991797
[case "${enableval}" in
@@ -1811,6 +1809,17 @@ if test "x${IP}" = "xno"; then
18111809
fi
18121810
AM_CONDITIONAL(ENABLE_IP, test "x${IP}" = "xyes")
18131811

1812+
AC_ARG_ENABLE(imtcp-tests,
1813+
[AS_HELP_STRING([--enable-imtcp-tests],[imtcp-tests enabled @<:@default=yes@:>@])],
1814+
[case "${enableval}" in
1815+
yes) enable_imtcp_tests="yes" ;;
1816+
no) enable_imtcp_tests="no" ;;
1817+
*) AC_MSG_ERROR(bad value ${enableval} for --enable-imtcp-tests) ;;
1818+
esac],
1819+
[enable_imtcp_tests=yes]
1820+
)
1821+
AM_CONDITIONAL(ENABLE_IMTCP_TESTS, test "x${enable_imtcp_tests}" = "xyes")
1822+
18141823

18151824
# valgrind-testbench
18161825
AC_ARG_WITH([valgrind_testbench],
@@ -2017,6 +2026,58 @@ AC_ARG_ENABLE(imsolaris,
20172026
)
20182027
AM_CONDITIONAL(ENABLE_IMSOLARIS, test x$enable_imsolaris = xyes)
20192028

2029+
2030+
# settings for the imtcp input module
2031+
AC_ARG_ENABLE(imtcp_epoll,
2032+
[AS_HELP_STRING([--disable-imtcp-epoll],[Disable epoll mode in the TCP input module (for testing purposes)])],
2033+
[case "${enableval}" in
2034+
yes) enable_imtcp_epoll="yes" ;;
2035+
no) enable_imtcp_epoll="no" ;;
2036+
*) AC_MSG_ERROR([bad value ${enableval} for --disable-imtcp-epoll]) ;;
2037+
esac],
2038+
[enable_imtcp_epoll=auto]
2039+
)
2040+
2041+
# Default: Enable imtcp_epoll if epoll is available, unless explicitly disabled
2042+
if test "x$enable_imtcp_epoll" = "xauto"; then
2043+
if test "x$ac_cv_header_sys_epoll_h" = "xyes" && test "x$ac_cv_func_epoll_create" = "xyes"; then
2044+
enable_imtcp_epoll="yes"
2045+
else
2046+
enable_imtcp_epoll="no"
2047+
fi
2048+
fi
2049+
2050+
# Define ENABLE_IMTCP_EPOLL in config.h if epoll is enabled
2051+
if test "x$enable_imtcp_epoll" = "xyes"; then
2052+
AC_DEFINE([ENABLE_IMTCP_EPOLL], [1], [Enable epoll mode for the imtcp input module])
2053+
fi
2054+
2055+
# Automake conditional
2056+
AM_CONDITIONAL(ENABLE_IMTCP_EPOLL, test x$enable_imtcp_epoll = xyes)
2057+
2058+
Print result
2059+
echo " TCP input module epoll mode: $enable_imtcp_epoll"
2060+
2061+
2062+
2063+
2064+
# settings for the imtcp input module
2065+
AC_ARG_ENABLE(imtcp_epoll,
2066+
[AS_HELP_STRING([--enable-imtcp-epoll],[tcp input module epoll mode permitted @<:@default=yes@:>@])],
2067+
[case "${enableval}" in
2068+
yes) enable_imtcp_epoll="yes" ;;
2069+
no) enable_imtcp_epoll="no" ;;
2070+
*) AC_MSG_ERROR(bad value ${enableval} for --enable-imptcp-epoll) ;;
2071+
esac],
2072+
[enable_imptcp_epoll=yes]
2073+
)
2074+
AM_CONDITIONAL(ENABLE_IMPTCP_EPOLL, test x$enable_imptcp_epoll = xyes)
2075+
# Define a preprocessor macro if enabled
2076+
if test "x$enable_imtcp_epoll" = "xyes"; then
2077+
AC_DEFINE([ENABLE_IMTCP_EPOLL], [1], [Enable epoll mode for the imtcp input module])
2078+
fi
2079+
2080+
20202081
# settings for the ptcp input module
20212082
AC_ARG_ENABLE(imptcp,
20222083
[AS_HELP_STRING([--enable-imptcp],[plain tcp input module enabled @<:@default=no@:>@])],
@@ -3010,6 +3071,7 @@ if test "$unamestr" != "AIX"; then
30103071
echo " Klog functionality enabled: $enable_klog ($os_type)"
30113072
fi
30123073
echo " /dev/kmsg functionality enabled: $enable_kmsg"
3074+
echo " tcp input module epoll permitted: $enable_imtcp_epoll"
30133075
echo " plain tcp input module enabled: $enable_imptcp"
30143076
echo " DTLS udp input module enabled: $enable_imdtls"
30153077
echo " imdiag enabled: $enable_imdiag"
@@ -3124,6 +3186,7 @@ echo " Kafka Tests enabled: $enable_kafka_tests"
31243186
echo " Redis Tests enabled: $enable_redis_tests"
31253187
echo " Omazureeventhubs Tests enabled: $enable_omazureeventhubs_tests"
31263188
echo " Imdocker Tests enabled: $enable_imdocker_tests"
3189+
echo " imtcp tests enabled: $enable_imtcp_tests"
31273190
echo " gnutls tests enabled: $enable_gnutls_tests"
31283191
echo " imfile tests enabled: $enable_imfile_tests"
31293192
echo " systemd journal tests enabled: $enable_journal_tests"

plugins/imdiag/imdiag.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ addTCPListener(void __attribute__((unused)) *pVal, uchar *pNewVal)
617617
}
618618
CHKmalloc(cnf_params = (tcpLstnParams_t*) calloc(1, sizeof(tcpLstnParams_t)));
619619
CHKiRet(tcpsrv.Construct(&pOurTcpsrv));
620+
CHKiRet(tcpsrv.SetNumWrkr(pOurTcpsrv, 1)); // We always need only one worker for this diag module!
620621
CHKiRet(tcpsrv.SetSessMax(pOurTcpsrv, iTCPSessMax));
621622
CHKiRet(tcpsrv.SetCBIsPermittedHost(pOurTcpsrv, isPermittedHost));
622623
CHKiRet(tcpsrv.SetCBRcvData(pOurTcpsrv, doRcvData));

plugins/imtcp/imtcp.c

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ static int n_tcpsrv = 0;
9191

9292
static permittedPeers_t *pPermPeersRoot = NULL;
9393

94+
/* default number of workes to configure. We choose 2, as this is probably good for
95+
* many installations. High-Volume ones may need much higher number!
96+
*/
97+
#define DEFAULT_NUMWRKR 2
98+
#define DEFAULT_STARVATIONMAXREADS 500
99+
94100
#define FRAMING_UNSET -1
95101

96102
/* config settings */
@@ -123,6 +129,7 @@ static struct configSettings_s {
123129
struct instanceConf_s {
124130
int iTCPSessMax;
125131
int iTCPLstnMax;
132+
unsigned numWrkr;
126133
tcpLstnParams_t *cnf_params; /**< listener config parameters */
127134
uchar *pszBindRuleset; /* name of ruleset to bind to */
128135
ruleset_t *pBindRuleset; /* ruleset to bind listener to (use system default if unspecified) */
@@ -157,6 +164,7 @@ struct instanceConf_s {
157164
int iKeepAliveIntvl;
158165
int iKeepAliveProbes;
159166
int iKeepAliveTime;
167+
unsigned starvationMaxReads;
160168
struct instanceConf_s *next;
161169
};
162170

@@ -166,6 +174,7 @@ struct modConfData_s {
166174
instanceConf_t *root, *tail;
167175
int iTCPSessMax; /* max number of sessions */
168176
int iTCPLstnMax; /* max number of sessions */
177+
unsigned numWrkr;
169178
int iStrmDrvrMode; /* mode for stream driver, driver-dependent (0 mostly means plain tcp) */
170179
int iStrmDrvrExtendedCertCheck; /* verify also purpose OID in certificate extended field */
171180
int iStrmDrvrSANPreference; /* ignore CN when any SAN set */
@@ -193,6 +202,7 @@ struct modConfData_s {
193202
permittedPeers_t *pPermPeersRoot;
194203
sbool configSetViaV2Method;
195204
sbool bPreserveCase; /* preserve case of fromhost; true by default */
205+
unsigned starvationMaxReads;
196206
};
197207

198208
static modConfData_t *loadModConf = NULL;/* modConf ptr to use for the current load process */
@@ -211,6 +221,8 @@ static struct cnfparamdescr modpdescr[] = {
211221
{ "maxsessions", eCmdHdlrPositiveInt, 0 },
212222
{ "maxlistners", eCmdHdlrPositiveInt, 0 },
213223
{ "maxlisteners", eCmdHdlrPositiveInt, 0 },
224+
{ "workerthreads", eCmdHdlrPositiveInt, 0 },
225+
{ "starvationprotection.maxreads", eCmdHdlrNonNegInt, 0 },
214226
{ "streamdriver.mode", eCmdHdlrNonNegInt, 0 },
215227
{ "streamdriver.authmode", eCmdHdlrString, 0 },
216228
{ "streamdriver.permitexpiredcerts", eCmdHdlrString, 0 },
@@ -241,6 +253,7 @@ static struct cnfparamdescr inppdescr[] = {
241253
{ "port", eCmdHdlrString, CNFPARAM_REQUIRED }, /* legacy: InputTCPServerRun */
242254
{ "maxsessions", eCmdHdlrPositiveInt, 0 },
243255
{ "maxlisteners", eCmdHdlrPositiveInt, 0 },
256+
{ "workerthreads", eCmdHdlrPositiveInt, 0 },
244257
{ "flowcontrol", eCmdHdlrBinary, 0 },
245258
{ "disablelfdelimiter", eCmdHdlrBinary, 0 },
246259
{ "discardtruncatedmsg", eCmdHdlrBinary, 0 },
@@ -254,6 +267,7 @@ static struct cnfparamdescr inppdescr[] = {
254267
{ "name", eCmdHdlrString, 0 },
255268
{ "defaulttz", eCmdHdlrString, 0 },
256269
{ "ruleset", eCmdHdlrString, 0 },
270+
{ "starvationprotection.maxreads", eCmdHdlrNonNegInt, 0 },
257271
{ "streamdriver.mode", eCmdHdlrNonNegInt, 0 },
258272
{ "streamdriver.authmode", eCmdHdlrString, 0 },
259273
{ "streamdriver.permitexpiredcerts", eCmdHdlrString, 0 },
@@ -403,6 +417,8 @@ createInstance(instanceConf_t **pinst)
403417
inst->iSynBacklog = 0; /* default: unset */
404418
inst->iTCPLstnMax = loadModConf->iTCPLstnMax;
405419
inst->iTCPSessMax = loadModConf->iTCPSessMax;
420+
inst->numWrkr = loadModConf->numWrkr;
421+
inst->starvationMaxReads = loadModConf->starvationMaxReads;
406422

407423
inst->cnf_params->pszLstnPortFileName = NULL;
408424

@@ -473,6 +489,8 @@ static rsRetVal addInstance(void __attribute__((unused)) *pVal, uchar *pNewVal)
473489
inst->iAddtlFrameDelim = cs.iAddtlFrameDelim;
474490
inst->iTCPLstnMax = cs.iTCPLstnMax;
475491
inst->iTCPSessMax = cs.iTCPSessMax;
492+
inst->numWrkr = DEFAULT_NUMWRKR;
493+
inst->starvationMaxReads = DEFAULT_STARVATIONMAXREADS;
476494
inst->iStrmDrvrMode = cs.iStrmDrvrMode;
477495

478496
finalize_it:
@@ -497,6 +515,8 @@ addListner(modConfData_t *modConf, instanceConf_t *inst)
497515
CHKiRet(tcpsrv.SetCBOnRegularClose(pOurTcpsrv, onRegularClose));
498516
CHKiRet(tcpsrv.SetCBOnErrClose(pOurTcpsrv, onErrClose));
499517
/* params */
518+
CHKiRet(tcpsrv.SetNumWrkr(pOurTcpsrv, inst->numWrkr));
519+
CHKiRet(tcpsrv.SetStarvationMaxReads(pOurTcpsrv, inst->starvationMaxReads));
500520
CHKiRet(tcpsrv.SetKeepAlive(pOurTcpsrv, inst->bKeepAlive));
501521
CHKiRet(tcpsrv.SetKeepAliveIntvl(pOurTcpsrv, inst->iKeepAliveIntvl));
502522
CHKiRet(tcpsrv.SetKeepAliveProbes(pOurTcpsrv, inst->iKeepAliveProbes));
@@ -652,6 +672,8 @@ CODESTARTnewInpInst
652672
inst->pszStrmDrvrCertFile = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL);
653673
} else if(!strcmp(inppblk.descr[i].name, "streamdriver.name")) {
654674
inst->pszStrmDrvrName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL);
675+
} else if(!strcmp(inppblk.descr[i].name, "starvationprotection.maxreads")) {
676+
inst->starvationMaxReads = (unsigned) pvals[i].val.d.n;
655677
} else if(!strcmp(inppblk.descr[i].name, "gnutlsprioritystring")) {
656678
inst->gnutlsPriorityString = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL);
657679
} else if(!strcmp(inppblk.descr[i].name, "permittedpeer")) {
@@ -685,6 +707,8 @@ CODESTARTnewInpInst
685707
inst->iTCPSessMax = (int) pvals[i].val.d.n;
686708
} else if(!strcmp(inppblk.descr[i].name, "maxlisteners")) {
687709
inst->iTCPLstnMax = (int) pvals[i].val.d.n;
710+
} else if(!strcmp(inppblk.descr[i].name, "workerthreads")) {
711+
inst->numWrkr = (int) pvals[i].val.d.n;
688712
} else if(!strcmp(inppblk.descr[i].name, "supportoctetcountedframing")) {
689713
inst->cnf_params->bSuppOctetFram = (int) pvals[i].val.d.n;
690714
} else if(!strcmp(inppblk.descr[i].name, "keepalive")) {
@@ -723,6 +747,8 @@ CODESTARTbeginCnfLoad
723747
/* init our settings */
724748
loadModConf->iTCPSessMax = 200;
725749
loadModConf->iTCPLstnMax = 20;
750+
loadModConf->numWrkr = DEFAULT_NUMWRKR;
751+
loadModConf->starvationMaxReads = DEFAULT_STARVATIONMAXREADS;
726752
loadModConf->bSuppOctetFram = 1;
727753
loadModConf->iStrmDrvrMode = 0;
728754
loadModConf->iStrmDrvrExtendedCertCheck = 0;
@@ -800,9 +826,13 @@ CODESTARTsetModCnf
800826
}
801827
} else if(!strcmp(modpblk.descr[i].name, "maxsessions")) {
802828
loadModConf->iTCPSessMax = (int) pvals[i].val.d.n;
829+
} else if(!strcmp(modpblk.descr[i].name, "starvationprotection.maxreads")) {
830+
loadModConf->starvationMaxReads = (unsigned) pvals[i].val.d.n;
803831
} else if(!strcmp(modpblk.descr[i].name, "maxlisteners") ||
804832
!strcmp(modpblk.descr[i].name, "maxlistners")) { /* keep old name for a while */
805833
loadModConf->iTCPLstnMax = (int) pvals[i].val.d.n;
834+
} else if(!strcmp(modpblk.descr[i].name, "workerthreads")) {
835+
loadModConf->numWrkr = (int) pvals[i].val.d.n;
806836
} else if(!strcmp(modpblk.descr[i].name, "keepalive")) {
807837
loadModConf->bKeepAlive = (int) pvals[i].val.d.n;
808838
} else if(!strcmp(modpblk.descr[i].name, "keepalive.probes")) {
@@ -1078,7 +1108,6 @@ CODESTARTafterRun
10781108
tcpsrv_etry_t *del;
10791109
while(etry != NULL) {
10801110
iRet = tcpsrv.Destruct(&etry->tcpsrv);
1081-
// TODO: check iRet, reprot error
10821111
del = etry;
10831112
etry = etry->next;
10841113
free(del);

runtime/Makefile.am

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ endif
179179

180180
# network stream master class and stream factory
181181
lmnetstrms_la_SOURCES = netstrms.c netstrms.h \
182-
netstrm.c netstrm.h \
183-
nssel.c nssel.h \
184-
nspoll.c nspoll.h
182+
netstrm.c netstrm.h
185183
lmnetstrms_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
186184
lmnetstrms_la_LDFLAGS = -module -avoid-version
187185
lmnetstrms_la_LIBADD =
@@ -195,9 +193,7 @@ endif
195193

196194
# plain tcp driver - main driver
197195
pkglib_LTLIBRARIES += lmnsd_ptcp.la
198-
lmnsd_ptcp_la_SOURCES = nsd_ptcp.c nsd_ptcp.h \
199-
nsdsel_ptcp.c nsdsel_ptcp.h \
200-
nsdpoll_ptcp.c nsdpoll_ptcp.h
196+
lmnsd_ptcp_la_SOURCES = nsd_ptcp.c nsd_ptcp.h
201197
lmnsd_ptcp_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
202198
lmnsd_ptcp_la_LDFLAGS = -module -avoid-version
203199
lmnsd_ptcp_la_LIBADD =
@@ -215,7 +211,7 @@ endif # if ENABLE_INET
215211
if ENABLE_OPENSSL
216212
# noinst_LTLIBRARIES += lmnsd_ossl.la
217213
pkglib_LTLIBRARIES += lmnsd_ossl.la
218-
lmnsd_ossl_la_SOURCES = net_ossl.c net_ossl.h nsd_ossl.c nsd_ossl.h nsdsel_ossl.c nsdsel_ossl.h
214+
lmnsd_ossl_la_SOURCES = net_ossl.c net_ossl.h nsd_ossl.c nsd_ossl.h
219215
lmnsd_ossl_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) $(OPENSSL_CFLAGS)
220216
lmnsd_ossl_la_LDFLAGS = -module -avoid-version
221217
lmnsd_ossl_la_LIBADD = $(OPENSSL_LIBS)
@@ -227,7 +223,7 @@ endif
227223
#
228224
if ENABLE_GNUTLS
229225
pkglib_LTLIBRARIES += lmnsd_gtls.la
230-
lmnsd_gtls_la_SOURCES = nsd_gtls.c nsd_gtls.h nsdsel_gtls.c nsdsel_gtls.h
226+
lmnsd_gtls_la_SOURCES = nsd_gtls.c nsd_gtls.h
231227
lmnsd_gtls_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS) $(GNUTLS_CFLAGS)
232228
lmnsd_gtls_la_LDFLAGS = -module -avoid-version
233229
lmnsd_gtls_la_LIBADD = $(GNUTLS_LIBS)

runtime/netstrms.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
#include "obj.h"
3535
#include "nsd.h"
3636
#include "netstrm.h"
37-
#include "nssel.h"
38-
#include "nspoll.h"
3937
#include "netstrms.h"
4038
#include "rsconf.h"
4139

@@ -539,8 +537,6 @@ ENDObjClassInit(netstrms)
539537

540538
BEGINmodExit
541539
CODESTARTmodExit
542-
nsselClassExit();
543-
nspollClassExit();
544540
netstrmsClassExit();
545541
netstrmClassExit(); /* we use this object, so we must exit it after we are finished */
546542
ENDmodExit
@@ -558,7 +554,5 @@ CODESTARTmodInit
558554

559555
/* Initialize all classes that are in our module - this includes ourselfs */
560556
CHKiRet(netstrmClassInit(pModInfo));
561-
CHKiRet(nsselClassInit(pModInfo));
562-
CHKiRet(nspollClassInit(pModInfo));
563557
CHKiRet(netstrmsClassInit(pModInfo));
564558
ENDmodInit

0 commit comments

Comments
 (0)