mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-08 06:31:58 +00:00
added exceptions counter
This commit is contained in:
@@ -378,12 +378,9 @@ PyObject *uwsgi_uwsgi_loader(void *arg1) {
|
||||
if (applications && PyDict_Check(applications)) return applications;
|
||||
|
||||
|
||||
uwsgi_log("QUICK CALLABLE = %s\n", quick_callable);
|
||||
applications = PyDict_GetItemString(wsgi_dict, "applications");
|
||||
if (applications && PyDict_Check(applications)) return applications;
|
||||
|
||||
uwsgi_log("QUICK CALLABLE = %s\n", quick_callable);
|
||||
|
||||
// quick callable -> thanks gunicorn for the idea
|
||||
// we have extended the concept a bit...
|
||||
if (quick_callable[strlen(quick_callable) -2 ] == '(' && quick_callable[strlen(quick_callable) -1] ==')') {
|
||||
|
||||
@@ -19,6 +19,7 @@ PyObject *python_call(PyObject *callable, PyObject *args, int catch) {
|
||||
if (PyErr_ExceptionMatches(PyExc_MemoryError)) {
|
||||
uwsgi_log("Memory Error detected !!!\n");
|
||||
}
|
||||
uwsgi.workers[uwsgi.mywid].exceptions++;
|
||||
if (!catch) {
|
||||
PyErr_Print();
|
||||
}
|
||||
|
||||
@@ -1722,6 +1722,12 @@ clear:
|
||||
}
|
||||
Py_DECREF(zero);
|
||||
|
||||
zero = PyInt_FromLong(uwsgi.workers[i + 1].exceptions);
|
||||
if (PyDict_SetItemString(worker_dict, "exceptions", zero)) {
|
||||
goto clear;
|
||||
}
|
||||
Py_DECREF(zero);
|
||||
|
||||
zero = PyInt_FromLong(uwsgi.workers[i + 1].rss_size);
|
||||
if (PyDict_SetItemString(worker_dict, "rss", zero)) {
|
||||
goto clear;
|
||||
|
||||
@@ -169,6 +169,7 @@ int uwsgi_response_subhandler_wsgi(struct wsgi_request *wsgi_req) {
|
||||
if (PyErr_ExceptionMatches(PyExc_MemoryError)) {
|
||||
uwsgi_log("Memory Error detected !!!\n");
|
||||
}
|
||||
uwsgi.workers[uwsgi.mywid].exceptions++;
|
||||
PyErr_Print();
|
||||
}
|
||||
goto clear;
|
||||
|
||||
Reference in New Issue
Block a user