From 08b6d16ffced0fd52ddb099d9289c98deafb23ab Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Tue, 15 Jan 2013 21:53:07 +0000 Subject: [PATCH] Log a warning if ThreadStackSize has an inappropriate value. PR : 54311 Submitted by: Tianyin Xu Only event.c has been compiled on my system. The 2 others are just cut and paste. I have left the same value for APLOGNO in event and eventopt has for the other logged messages. I don't know if it is the right way to do. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1433682 13f79535-47bb-0310-9956-ffa450edef68 --- docs/log-message-tags/next-number | 2 +- server/mpm/event/event.c | 8 +++++++- server/mpm/eventopt/eventopt.c | 8 +++++++- server/mpm/worker/worker.c | 8 +++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/log-message-tags/next-number b/docs/log-message-tags/next-number index ad9c931523..9243b02f5b 100644 --- a/docs/log-message-tags/next-number +++ b/docs/log-message-tags/next-number @@ -1 +1 @@ -2435 +2437 diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 23d3c0e010..d2223636ea 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -2217,7 +2217,13 @@ static void child_main(int child_num_arg) apr_threadattr_detach_set(thread_attr, 0); if (ap_thread_stacksize != 0) { - apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + rv = apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) { + ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, APLOGNO(02436) + "WARNING: ThreadStackSize of %" APR_SIZE_T_FMT " is " + "inappropriate, using default", + ap_thread_stacksize); + } } ts->threads = threads; diff --git a/server/mpm/eventopt/eventopt.c b/server/mpm/eventopt/eventopt.c index 7dcebf3d71..0ecfc16bed 100644 --- a/server/mpm/eventopt/eventopt.c +++ b/server/mpm/eventopt/eventopt.c @@ -2222,7 +2222,13 @@ static void child_main(int child_num_arg) apr_threadattr_detach_set(thread_attr, 0); if (ap_thread_stacksize != 0) { - apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + rv = apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) { + ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, APLOGNO(02436) + "WARNING: ThreadStackSize of %" APR_SIZE_T_FMT " is " + "inappropriate, using default", + ap_thread_stacksize); + } } ts->threads = threads; diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index bd105ce307..47c144d4ef 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -1275,7 +1275,13 @@ static void child_main(int child_num_arg) apr_threadattr_detach_set(thread_attr, 0); if (ap_thread_stacksize != 0) { - apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + rv = apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) { + ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, APLOGNO(02435) + "WARNING: ThreadStackSize of %" APR_SIZE_T_FMT " is " + "inappropriate, using default", + ap_thread_stacksize); + } } ts->threads = threads; -- 2.40.0