Skip to content

Commit 2765518

Browse files
Merge branch 'develop' into feature/request-metrics
2 parents 7fedebd + f6056e2 commit 2765518

File tree

4 files changed

+32
-22
lines changed

4 files changed

+32
-22
lines changed

docs/release-notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Release Notes
55
.. toctree::
66
:maxdepth: 2
77

8+
release-notes/version-4.4.22
89
release-notes/version-4.4.21
910
release-notes/version-4.4.20
1011
release-notes/version-4.4.19

docs/release-notes/version-4.4.22.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
==============
2+
Version 4.4.22
3+
==============
4+
5+
Version 4.4.22 of mod_wsgi can be obtained from:
6+
7+
https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.4.22
8+
9+
For details on the availability of Windows binaries see:
10+
11+
https://github.com/GrahamDumpleton/mod_wsgi/tree/master/win32
12+
13+
Bugs Fixed
14+
----------
15+
16+
1. Stack traces logged at ``INFO`` level when a request timeout occurred
17+
were not displaying correctly when Python 3 was being used. It is possible
18+
that the logging code could also have caused the process to then crash as
19+
the process was shutting down.

src/server/mod_wsgi.c

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8965,50 +8965,40 @@ static void wsgi_log_stack_traces(void)
89658965
while (current) {
89668966
int lineno;
89678967

8968-
PyObject *filename = NULL;
8969-
PyObject *name = NULL;
8968+
char *filename = NULL;
8969+
char *name = NULL;
89708970

89718971
lineno = current->f_lineno;
89728972

8973-
#if PY_MAJOR_VERSION > 3
8974-
filename = PyUnicode_EncodeUTF8(
8975-
current->f_code->co_filename);
8976-
name = PyUnicode_EncodeUTF8(
8977-
current->f_code->co_name);
8973+
#if PY_MAJOR_VERSION >= 3
8974+
filename = PyUnicode_AsUTF8(current->f_code->co_filename);
8975+
name = PyUnicode_AsUTF8(current->f_code->co_name);
89788976
#else
8979-
Py_INCREF(current->f_code->co_filename);
8980-
filename = current->f_code->co_filename;
8981-
Py_INCREF(current->f_code->co_name);
8982-
name = current->f_code->co_name;
8977+
filename = PyString_AsString(current->f_code->co_filename);
8978+
name = PyString_AsString(current->f_code->co_name);
89838979
#endif
89848980

89858981
if (current == (PyFrameObject *)frame) {
89868982
ap_log_error(APLOG_MARK, APLOG_INFO, 0, wsgi_server,
89878983
"mod_wsgi (pid=%d): Thread %ld executing "
89888984
"file \"%s\", line %d, in %s", getpid(),
8989-
thread_id, PyString_AsString(filename),
8990-
lineno, PyString_AsString(name));
8985+
thread_id, filename, lineno, name);
89918986
}
89928987
else {
89938988
if (current->f_back) {
89948989
ap_log_error(APLOG_MARK, APLOG_INFO, 0, wsgi_server,
89958990
"mod_wsgi (pid=%d): called from file "
89968991
"\"%s\", line %d, in %s,", getpid(),
8997-
PyString_AsString(filename), lineno,
8998-
PyString_AsString(name));
8992+
filename, lineno, name);
89998993
}
90008994
else {
90018995
ap_log_error(APLOG_MARK, APLOG_INFO, 0, wsgi_server,
90028996
"mod_wsgi (pid=%d): called from file "
90038997
"\"%s\", line %d, in %s.", getpid(),
9004-
PyString_AsString(filename), lineno,
9005-
PyString_AsString(name));
8998+
filename, lineno, name);
90068999
}
90079000
}
90089001

9009-
Py_DECREF(filename);
9010-
Py_DECREF(name);
9011-
90129002
current = current->f_back;
90139003
}
90149004
}

src/server/wsgi_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
#define MOD_WSGI_MAJORVERSION_NUMBER 4
2727
#define MOD_WSGI_MINORVERSION_NUMBER 4
28-
#define MOD_WSGI_MICROVERSION_NUMBER 21
29-
#define MOD_WSGI_VERSION_STRING "4.4.21"
28+
#define MOD_WSGI_MICROVERSION_NUMBER 22
29+
#define MOD_WSGI_VERSION_STRING "4.4.22"
3030

3131
/* ------------------------------------------------------------------------- */
3232

0 commit comments

Comments
 (0)