Joe Orton [Fri, 7 Feb 2020 16:56:40 +0000 (16:56 +0000)]
Merge r1867970 from trunk:
* modules/generators/cgi_common.h (discard_script_output): Simplify
slightly and ensure constant rather than unlimited memory
consumption when discarding CGI script output (for e.g. a redirect
response).
* configure.in: Add systemd to HTTPD_LIBS rather than LIBS. Add PCRE
libs to HTTPD_LIBS.
* configure.in, acinclude.m4: Move systemd check to APACHE_CHECK_SYSTEMD
and use pkg-config where available.
mod_systemd: Add IdleShutdown - number of seconds in idle-state after which
httpd is shutdown. This is useful in a combination with socket activation.
Add mod_systemd documentation.
mod_systemd: Use AP_SIG_GRACEFUL instead of SIGWINCH.
Fix overriding ExtendedStatus to "off" with mod_systemd loaded, and
give more feedback to systemd during a reload.
* modules/arch/unix/mod_systemd.c (systemd_pre_config): New
function; tell systemd the service is reloading here.
(systemd_pre_mpm): Don't set ap_extended_status here, do nothing
if ExtendedStatus is off.
(register_hooks): Register pre_config hook.
* modules/arch/unix/mod_systemd.c (systemd_post_config): Fix systemd
service getting stuck reloading if "ExtendedStatus off" is
configured; regression in r1802251.
PR: 62697
* modules/arch/unix/mod_systemd.c (systemd_pre_mpm, systemd_monitor):
Ignore sd_notify{,f} failure cases as currently recommended by the
systemd API docs.
* modules/arch/unix/mod_systemd.c: Remove IdleShutdown feature which
was buggy per sf's feedback in 2.4.x backport proposal, and would
probably be more appropriate outside this module anyway.
* modules/arch/unix/config5.m4: Don't override enable_systemd, fixing
--enable-systemd=static per covener's suggestion in
<CALK=YjPrN644NtLROwYPyBeCpev-GHSAD2J-Z2hupLymZ0op-g@mail.gmail.com>
Also fix the APACHE_MODULE() usage; disable the module by default
for the "all" modules selection.
Luca Toscano [Fri, 31 Jan 2020 16:12:33 +0000 (16:12 +0000)]
Vote on mod_systemd's backport patch
Tested building the module from a fresh copy of 2.4.x
on Debian 10 (Buster). Tested a systemd unit with "Type=notify",
everything works as expected. Thanks Joe!
Joe Orton [Wed, 15 Jan 2020 17:43:42 +0000 (17:43 +0000)]
Simplified mod_systemd backport proposal w/o IdleShutdown feature.
Note partial merge of some commits, socket activation changes are
excluded. mod_systemd.c as proposed is exactly as in trunk.
mod_proxy: fix proxy connection cleanup from an n+2 pool.
When connection_destructor() is called after pchild is gone, we can't
dereference worker->cp anymore. This happens is debug/one_process mode only,
if we exit by calling apr_terminate() or clearing the process pool directly.
Fix this by NULL-ing worker->cp in conn_pool_cleanup(), and by registering it
as a pre_cleanup.
Delay some memory allocation.
If this handler will not handle the request, no need to waste bytes in the request pool.
Add error messages and return bad request.
fix incorrect rv. Sorry.
Follow up to r1847232.
There is no point to use "old" numbers in recent commit.
Also avoid number duplication. The messages are the same but in different code path, so having different numbers makes sense.
This also avoids a warning when running:
make update-log-msg-tags
Make proxy modules compile if APR_HAS_THREADS is not defined.
restore use of global mutex under !APR_HAS_THREADS
followup to r1852442 which appears to have been too agressive in wrapping
blocks with #if APR_HAS_THREADS. With !APR_HAS_THREADS a global mutex
is a proc mutex.
* Add back logging goodness
Add back logging goodness added by covener in r1865938.
Fix pool concurrency problems
Create a subpool of the connection pool for worker scoped DNS resolutions.
This is needed to avoid race conditions in using the connection pool by multiple
threads during ramp up.
Recheck after obtaining the lock if we still need to do things or if they
were already done by another thread while we were waiting on the lock.
* modules/proxy/proxy_util.c: Create a subpool of the connection pool for worker
scoped DNS resolutions and use it.
* modules/proxy/mod_proxy.h: Define AP_VOLATILIZE_T and add dns_pool to
struct proxy_conn_pool.
* modules/proxy/mod_proxy_ftp.c: Use dns_pool and consider that
worker->cp->addr is volatile in this location of the code.
Skip "PCRE 1" job for 2.4.x since there's no PCRE 2 support.
Enable ppc64le builds, caching now seems to work in Travis for non-x86.
travis: enable email notifications on success as test
adding myself for debugging (happy 113th birthday to the inventor of that term\!)
does this work??
travis: send notification to httpd-dev@ only on failure
Due to a combination of Daniel's work and probably some fix
on Travis end, we are now finally getting Travis emails in
httpd-dev@. Since having notifications for successful builds
might become a little spammy, let's just alert when a build
fails (like we do with buildbot IIUC).
travis: sync trunk's notification config with 2.4.x
test/travis_before_linux.sh: add a simple bash retry to svn export
Sometimes a build is killed by Travis due to svn export taking
a long time to complete (> 10m). This change should be a test to see
if a simple workaround reduces the noise to the dev@ mailing list.
test/travis_before_linux.sh: remove bash -e flag
To allow a proper fail/retry, -e needs to be removed.
Ideally this shouldn't happen, so I'd consider this
a test to see if the bash for workaround is a viable
option or not.
test/travis_before_linux.sh: make for loop more resilient
This is a follow up to my last commit to this file, to make
the for loop more resilient with the following:
- use --force in svn export, otherwise the second attempt will
always fail due to the dest directory already present.
- exit 1 in case the 5 tries end up in a non zero exit code
(to fail fast the build).
travis: temporary disable notifications to dev@
There seem to be some issues to iron out, disabling
email notifications to avoid spamming dev@.
test/travis_before_linux.sh: move retry logic to function
Move the retry logic to a bash function and restore the -e
failure policy in the script (to have cleaner log traces
in base of build failures).
Work around a build failure when a cached APR branch install
is used but APR-util needs to be rebuilt; currently this fails
because the APR build directory is not available.
e.g. https://travis-ci.org/apache/httpd/jobs/630885203
Disable caching for this combination for now.
travis: restore email notifications for dev@
The issue with ppcle64 seems to be fixed from [1],
and Joe fixed the APR 1.7.x issue as well. Builds are
back to normal.
test/travis_before_linux.sh: increase backoff time before executing svn export
Cache SVN checkout of test/framework across Travis builds. Should
improve reliability (the checkout fails frequently) and performance,
plus reduces load on ASF infra.
Github: closes #85
Add Travis job which runs tests in random order.
Github: closes #86
travis: add verbose config to perl test suite for Ubuntu Worker All Modules
For some reason we get sporadic failures only in Ubuntu Worker All Modules' test:
t/apache/rwrite.t ................... 53/? # Failed test 113 in /home/travis/build/apache/httpd/test/perl-framework/blib/lib/Apache/TestCommon.pm at line 56 fail #113
t/apache/rwrite.t ................... Failed 1/114 subtests
Graham Leggett [Wed, 1 Jan 2020 23:26:43 +0000 (23:26 +0000)]
Backport:
mod_http2: Fixed interaction with mod_reqtimeout. A loaded mod_http2 was disabling the
ssl handshake timeouts. Also, fixed a mistake of the last version that made `H2Direct`
always `on`, irregardless of configuration.
mod_http2: Multiple field length violations in the same request no longer cause
several log entries to be written.
Run buildconf using the specific APR/APR-util versions if configured.
Revert r1869541 and always run httpd's buildconf against the Debian APR,
which does include the *.m4 files.
Add shared-mpms build, add build against APR trunk (httpd trunk only).
Fix handling and ensure safe caching of APR trunk build.
Fix yaml typo.
* .travis.yml: Build on Bionic by default, only build w/APR 1.5.x for
the 2.4.x branch.
* .travis.yml, test/travis_run_linux.sh: Pass BUILDCONF to buildconf
and add job which uses the new option.
Install PCRE v2 (10.x) by default, add a job testing with PCRE "v1" (8.x).
Minor Travis doc updates and a todo list.
Test IRC and e-mail notifications.
Add build job for trunk on Xenial with custom APR/APR-util builds.
Try mailing dev@ for Travis build results.
The defaults are to mail:
- on success (if changed from failure)
- on failure (always)
Specify make flags globally and work around PR 63942 for regeneration
of server/util_expr parser.
Support travis builds against APR/APR-util non-trunk branches.
Add job for APR 1.7.x + APR-util 1.7.x.
Build on s390x (interesting test target since it's big-endian).
IRC notifications work, e-mail doesn't; branches are done.
ppc64le builds also work but are extremely slow, so not enabled.
Doc updates for Travis.
Note that APU_VERSION=trunk doesn't work per rpluem's mail.
Pull in more -dev packages to get more modules building (including mod_md).
Test gcc 7 on bionic, xenial is the Travis default anyway.
Only add the toolchain PPA where really needed.
Update travis config
* Add 'if TRAVIS_OS_NAME' to before_install/before_script/script to allow multi-os testing.
* Add separation lines in matrix config (better visual impact).
* Add Linux to all the current job's name.
* Add tests for Worker mpm.
Move before/run scripts out of .travis.yml.
Reviewed by: elukey
Support 2.4.x builds, which lacks --with-test-suite support.
Build with --enable-load-all-modules only when the test suite is run.
Add Travis support for multiple APR/APR-util versions.
Add an APR build with --enable-pool-debug.
Build all modules when testing APR variations.
Build APR-util 1.6.x --with-crypto otherwise the "mod_crypto" build fails,
though this is a bug: https://travis-ci.org/apache/httpd/jobs/609166867
Add APR 1.4/APR-util 1.4 build, but only for 2.4.x.
Start sketching out some travis docs and check we can -> [skip ci]