1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00
Commit Graph

1946 Commits

Author SHA1 Message Date
William A. Rowe Jr
ff0f1b909a If the lingering close does not leave the socket in a disconnected state,
do not recycle the socket.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1790978 13f79535-47bb-0310-9956-ffa450edef68
2017-04-11 14:09:00 +00:00
Stefan Eissing
354e89a57e On the trunk:
mpm_winnt: always invoke ap_lingering_close() at connection end.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1790973 13f79535-47bb-0310-9956-ffa450edef68
2017-04-11 13:41:44 +00:00
Yann Ylavic
841802066c mpm_event: no mutex needed at ptrans' allocator level.
(reverts r1783761 and r1783755 partially, style changes preserved)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783896 13f79535-47bb-0310-9956-ffa450edef68
2017-02-21 14:33:30 +00:00
Yann Ylavic
afea2aad65 mpm_worker: no mutex needed at ptrans' allocator level.
(reverts r1783808)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783895 13f79535-47bb-0310-9956-ffa450edef68
2017-02-21 14:24:14 +00:00
Yann Ylavic
03545993ce mpm_motorz: no mutex needed at ptrans' allocator level.
(reverts r1783755 partially)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783894 13f79535-47bb-0310-9956-ffa450edef68
2017-02-21 14:21:44 +00:00
Yann Ylavic
f46d03312e MPMs unix: Place signals handlers and helpers out of DSOs to avoid
a possible crash if a signal is caught during (graceful) restart.
PR 60487.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783849 13f79535-47bb-0310-9956-ffa450edef68
2017-02-21 09:07:42 +00:00
Yann Ylavic
6101554faf mpm_motorz: follow up to r1783755.
Use an allocator and mutex for ptrans' to be safe with concurrent
creation and destruction of its subpools, like with mod_http2.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783810 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 22:50:56 +00:00
Yann Ylavic
5b8c9f7a26 mpm_worker: follow up to r1783755.
Use a mutex for ptrans' allocator to be safe with concurrent
creation and destruction of its subpools, like with mod_http2.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783808 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 22:49:05 +00:00
Yann Ylavic
45b1409887 mpm_motorz: follow up to r1783772, with the real changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783782 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 16:55:50 +00:00
Yann Ylavic
f6cc395317 winnt/service: each log message should use its own APLOGNO.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783770 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 14:15:40 +00:00
Yann Ylavic
16dc9c205a Follow up to r1783755: update APLOGNO.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783761 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 13:56:32 +00:00
Yann Ylavic
6699f4e509 Revert r1783759: really more things than intended :p
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783760 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 13:53:16 +00:00
Yann Ylavic
37ebaff84d Follow up to r1783755: update APLOGNO.
[Reverted by r1783760]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783759 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 13:50:49 +00:00
Yann Ylavic
db8951e929 mpm_event: use a mutex for ptrans' allocator to be safe with concurrent
creation and destruction of its subpools, like with mod_http2.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783755 13f79535-47bb-0310-9956-ffa450edef68
2017-02-20 13:38:03 +00:00
Yann Ylavic
69c942269d event: follow up to r1762701.
Keep QUEUE_APPEND()+pollset_add() or QUEUE_REMOVE()+pollset_remove() atomic.

Otherwise when a worker adds an entry in some queue (e.g. KA, lingering), it
might race with the listener in the time between the mutex is released and the
pollset is updated; meanwhile the listener might process the queue and find an
entry no yet in its pollset.

For the lingering queue, the entry could then have been used after its pool
destroyed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1779354 13f79535-47bb-0310-9956-ffa450edef68
2017-01-18 16:08:51 +00:00
Eric Covener
14ade933dd assign a logno
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1775196 13f79535-47bb-0310-9956-ffa450edef68
2016-12-20 01:32:44 +00:00
Yann Ylavic
af22ceed1c event: close a race condition where we might re-enable listeners while they
are already or about to be closed.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1774541 13f79535-47bb-0310-9956-ffa450edef68
2016-12-15 23:55:12 +00:00
Yann Ylavic
f7ff940a29 event: follow up to r1762718.
On graceful shutdown/restart, kill kept-alive connections before poll()ing
again, avoiding to wait for their "normal" timers (before being woken up)
when they remain the last handled connections.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1774538 13f79535-47bb-0310-9956-ffa450edef68
2016-12-15 23:17:26 +00:00
Yann Ylavic
540e19cfb6 Revert r1774525, will commit a better way to handle this.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1774535 13f79535-47bb-0310-9956-ffa450edef68
2016-12-15 23:10:12 +00:00
Jim Jagielski
466ced7d02 kill the keepalive conns as early as possible during graceful
process exit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1774525 13f79535-47bb-0310-9956-ffa450edef68
2016-12-15 21:32:50 +00:00
Stefan Fritsch
31857a5cfa mpm_event: add clarifying comment
from jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1770768 13f79535-47bb-0310-9956-ffa450edef68
2016-11-21 21:41:23 +00:00
Stefan Fritsch
75aefb63e6 Use all available scoreboard slots
Allow to use all slots up to ServerLimit. This makes 'scoreboard full'
errors much less likely.

And if ther is a situation where the scoreboard is full, don't make any
more processes finish gracefully due to reduced load until some old
processes have terminated. Otherwise, the situation would get worse once
the load increases again.

ap_daemon_limit is renamed to the more descriptive active_server_limit,
to make sure that all its uses are taken care of.

PR 53555



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1770752 13f79535-47bb-0310-9956-ffa450edef68
2016-11-21 20:46:51 +00:00
Yann Ylavic
5f49eab313 event: follow up to r1762718 and r1762742: put de condition where it belongs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1762743 13f79535-47bb-0310-9956-ffa450edef68
2016-09-29 08:25:39 +00:00
Yann Ylavic
0a7dfee5f1 event: follow up to r1762718.
We still need to kill kept-alive connections in normal/expiry processing if
the workers are busy or dying.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1762742 13f79535-47bb-0310-9956-ffa450edef68
2016-09-29 08:15:33 +00:00
Yann Ylavic
a25b3473ba event: avoid unnecessary listener/polling wake ups (context switches) by using
apr_pollset_wakeup(), when implemented, to signal the listener according to the
next timers or timeout queues expiry (updated at insert and maintenance time).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1762718 13f79535-47bb-0310-9956-ffa450edef68
2016-09-28 22:02:48 +00:00
Yann Ylavic
ce6d2e012a event: compute now() in event_get_timer_event, when necessary.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1762707 13f79535-47bb-0310-9956-ffa450edef68
2016-09-28 20:48:30 +00:00
Yann Ylavic
4b223a6035 event: follow up to r1762701: update log tag.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1762702 13f79535-47bb-0310-9956-ffa450edef68
2016-09-28 20:07:03 +00:00
Yann Ylavic
5883237da4 event: add/remove from/to the pollset outside of the critical sections.
We don't need external locking since it's created with APR_POLLSET_THREADSAFE,
hence reduce those sections to the lowest cycles possible.

A spinlock may be interesting instead of the mutex now, we won't block and the
TO_QUEUE_*() and process_timeout_queue() operations are fast...



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1762701 13f79535-47bb-0310-9956-ffa450edef68
2016-09-28 20:01:48 +00:00
Yann Ylavic
eec2db85a2 event: use atomics for *timeout_queue->total since it's updated concurrently,
and move TO_QUEUE_*() macros to functions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1762580 13f79535-47bb-0310-9956-ffa450edef68
2016-09-27 22:01:28 +00:00
Yann Ylavic
679c46e823 event: follow up to r1593860.
Set timestamp before enqueing the timer on resume.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1762570 13f79535-47bb-0310-9956-ffa450edef68
2016-09-27 21:33:02 +00:00
Jacob Champion
3d0b52bd0a mpm_winnt: clear OVERLAPPED structs before reuse
MSDN documentation states that

    Any unused members of [an OVERLAPPED] structure should always be
    initialized to zero before the structure is used in a function call.
    Otherwise, the function may fail and return ERROR_INVALID_PARAMETER.

Prior to this patch, the internal state left over from previous
overlapped I/O was passed into the next call. It's unclear what effect
this might have, if any. (I have not personally witnessed an
ERROR_INVALID_PARAMETER myself.)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1758310 13f79535-47bb-0310-9956-ffa450edef68
2016-08-29 23:56:21 +00:00
Jacob Champion
80aa724ee0 mpm_winnt: remove duplication of ap_process_connection
Further follow-up to the previous commit: now that we no longer patch a
network bucket into the brigade, we can revert to calling
ap_process_connection() directly instead of duplicating its logic.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1758309 13f79535-47bb-0310-9956-ffa450edef68
2016-08-29 23:56:20 +00:00
Jacob Champion
6c9ee4bd3d mpm_winnt: remove the AcceptEx data network bucket
Follow-up to the prior commit: without an incoming data buffer, the
custom network bucket code is now orphaned and we can remove it
entirely. This has the added benefit that we are no longer using the
internal OVERLAPPED.Pointer field, which is discouraged by the MSDN
docs.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1758308 13f79535-47bb-0310-9956-ffa450edef68
2016-08-29 23:56:18 +00:00
Jacob Champion
f533af4b28 mpm_winnt: remove 'data' AcceptFilter in favor of 'connect'
The 'data' AcceptFilter optimization instructs Windows to wait until
data is received on a connection before completing the AcceptEx
operation. Unfortunately, it seems this isn't performed atomically --
AcceptEx "partially" accepts the incoming connection during the wait for
data, leaving all other incoming connections in the accept queue. This
opens the server to a denial of service.

Since the fix for this requires a substantial rearchitecture (likely
involving multiple outstanding calls to AcceptEx), disable the 'data'
filter for now and replace it with 'connect', which uses the AcceptEx
interface but does not wait for data.

Users running prior releases of httpd on Windows should explicitly move
to a 'connect' AcceptFilter in their configurations if they are
currently using the default 'data' filter.

Many thanks to mludha, Arthur Ramsey, Paul Spangler, and many others for
their assistance in tracking down and diagnosing this issue.

PR: 59970

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1758307 13f79535-47bb-0310-9956-ffa450edef68
2016-08-29 23:56:16 +00:00
Stefan Fritsch
04038d4d6e Revert "On exit, don't write to other generations' scoreboard slots"
As we have removed the possibility to re-use used scoreboard slots in r1757031,
we don't need this check anymore.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1757056 13f79535-47bb-0310-9956-ffa450edef68
2016-08-21 13:06:45 +00:00
Stefan Fritsch
b0bf11b8e6 mpm_event: don't re-use scoreboard slots that are still in use
This causes inconsistent data in the scoreboard (due to async
connections) and makes it difficult to determine what is going on.
Therefore it is not a useful fix for the scoreboard-full issues (PR
53555).

The consent on the dev list is that we should allocate/use more
scoreboard entries instead.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1757031 13f79535-47bb-0310-9956-ffa450edef68
2016-08-20 20:48:13 +00:00
Stefan Fritsch
c3293266ce mpm_event: minor code simplification
- move variable initializations into declarations
- use max_workers variable


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1757030 13f79535-47bb-0310-9956-ffa450edef68
2016-08-20 20:45:40 +00:00
Rainer Jung
d79b514c4b Fix spelling in comments and text files.
No functional change.
PR 59990


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756038 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 19:50:02 +00:00
Yann Ylavic
7932f3c76b Follow up to r1737447: fix max_spare_threads lower bound.
Suggested by: Rick Houser <rick.houser jackson.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750218 13f79535-47bb-0310-9956-ffa450edef68
2016-06-25 18:56:28 +00:00
William A. Rowe Jr
160eef0a0c Ensure http2 follows http in the meaning of
status WRITE (meaning 'in the request processing
  phase' even if still consuming the request body,
  not literally in a 'now writing' state).

  Ensure a number of MPMs and the h2 connection io
  no longer clobber the request status line during
  state-only changes.  While at it, clean up some
  very ugly formatting and unnecessary decoration,
  and avoid the wordy _from_conn() flavor when we
  are not passing a connection_rec.

  Ensure the useragent_ip is only used in the case
  where it has been initialized, fall back on the
  connection's remote_ip if the status is accidently
  updated from an uninitialized request_rec.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1741310 13f79535-47bb-0310-9956-ffa450edef68
2016-04-27 18:41:49 +00:00
William A. Rowe Jr
2343bb3829 Revert 1741277 - need a scoreboard by slot context here
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1741278 13f79535-47bb-0310-9956-ffa450edef68
2016-04-27 15:39:53 +00:00
William A. Rowe Jr
289bf1d276 Correct regressions introduced in r1137358 and r1740910.
The conn_rec context may be passed only when setting up the
initial connection, otherwise the request info is trashed.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1741277 13f79535-47bb-0310-9956-ffa450edef68
2016-04-27 15:24:33 +00:00
Yann Ylavic
bc55f0eb19 event: update worker score keepalive status.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1740910 13f79535-47bb-0310-9956-ffa450edef68
2016-04-25 21:50:40 +00:00
Stefan Fritsch
eac694d674 add comments
Document which directives set which variables


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1738633 13f79535-47bb-0310-9956-ffa450edef68
2016-04-11 19:54:38 +00:00
Stefan Fritsch
5643eb705d On exit, don't write to other generations' scoreboard slots
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1738632 13f79535-47bb-0310-9956-ffa450edef68
2016-04-11 19:52:35 +00:00
Stefan Fritsch
a05fa66be1 Don't take over scoreboard slots from gracefully finishing threads
Otherwise the old and the new thread will both update the same scoreboard slot
with undefined results.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1738631 13f79535-47bb-0310-9956-ffa450edef68
2016-04-11 19:50:28 +00:00
Stefan Fritsch
d9781f1734 Exit threads early during shutdown, part 2
Follow up to r1738466: During graceful shutdown, when the listener thread is
closing a connection, it needs to wake up a worker thread so that it may
terminate.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1738486 13f79535-47bb-0310-9956-ffa450edef68
2016-04-10 22:53:42 +00:00
Stefan Fritsch
ebc67fa6e1 Exit threads early during shutdown
During graceful shutdown, if there are more running worker threads than open
connections, terminate some threads. This frees resources faster, which may be
needed for new processes.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1738466 13f79535-47bb-0310-9956-ffa450edef68
2016-04-10 20:45:32 +00:00
Stefan Fritsch
598acf1743 Terminate keep-alive connections when dying
When shutting down a process gracefully, terminate keep-alive connections so
that we don't get any new requests which may keep the dying process alive
longer.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1738464 13f79535-47bb-0310-9956-ffa450edef68
2016-04-10 20:35:18 +00:00
Yann Ylavic
f2c1d8931b mpm_worker: follow up to r1737449.
Same spurious (duplicated) local variable removal, this time for mpm_worker.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1737451 13f79535-47bb-0310-9956-ffa450edef68
2016-04-01 22:59:21 +00:00