Fixes https://github.com/benoitc/gunicorn/issues/2784:
```
Traceback (most recent call last):
File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.7/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.7/site-packages/uvicorn/workers.py", line 66, in init_process
super(UvicornWorker, self).init_process()
File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.7/site-packages/gunicorn/workers/base.py", line 116, in init_process
self.log.close_on_exec()
File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.7/site-packages/gunicorn/glogging.py", line 381, in close_on_exec
for log in loggers():
File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.7/site-packages/gunicorn/glogging.py", line 94, in loggers
return [logging.getLogger(name) for name in existing]
File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.7/site-packages/gunicorn/glogging.py", line 94, in <listcomp>
return [logging.getLogger(name) for name in existing]
RuntimeError: dictionary changed size during iteration
```
According RFC-7617 (inherited from RFC-2978) schema and parameter names are handled
case insensitively:
```
Note that both scheme and parameter names are matched case-
insensitively.
```
Signed-off-by: Martin Bašti <mbasti@redhat.com>
These were originally based on 19.9.0 code and were rebased
with conflicts resolved.
Fixed#1690.
Co-Authored-By: dilyanpalauzov <git-dpa@aegee.org>
Signed-off-by: Brett Randall <javabrett@gmail.com>
logging.StreamHandler deault to sys.stderr, so make sure access log are printed to stdout when choosing "-" by forcing the stream.
Note: access logs were printed to stdout by default when using the config file.
fix#1184
Some systems edisable like SELINUX disable some flags so ignore the possible
error while chowning a log file. The error will be raised later anyway.
fix#1171
Bytes must be passed to socket.send.
Update tests to ensure an actual socket is used, so that errors like
this can be caught in unit tests in the future.
The debug setting has been removed and now only the debug level can be used to know if
we are in debug mode or not. This change update the gaiohttp worker to handle
that. While I'm here, expose the loglevel from the Logger class.
fix#977
Previously, resp.response_length is used for the b atom of the access
log formatter. If the application does not set a content-length header,
response_length is left as `None`, resulting in b being set to the
fallback "-". resp.sent is a more reliable way to determine the number
of bytes in the response body.