avoid async queue full log storming

This commit is contained in:
Unbit
2013-02-24 07:55:46 +01:00
parent 2a9835649e
commit 8d16ce28b9
4 changed files with 17 additions and 7 deletions
+9 -5
View File
@@ -2,6 +2,13 @@
extern struct uwsgi_server uwsgi;
void uwsgi_async_queue_is_full(time_t now) {
if (now > uwsgi.async_queue_is_full) {
uwsgi_log_verbose("[DANGER] async queue is full !!!\n");
uwsgi.async_queue_is_full = now;
}
}
void uwsgi_async_init() {
int i;
@@ -262,7 +269,7 @@ void async_loop() {
int is_a_new_connection;
int proto_parser_status;
uint64_t now, last_now = 0;
uint64_t now;
static struct uwsgi_async_request *current_request = NULL, *next_async_request = NULL;
@@ -340,10 +347,7 @@ void async_loop() {
uwsgi.wsgi_req = find_first_available_wsgi_req();
if (uwsgi.wsgi_req == NULL) {
if (now > last_now) {
uwsgi_log("async queue is full !!!\n");
last_now = now;
}
uwsgi_async_queue_is_full((time_t)now);
break;
}
+3 -1
View File
@@ -36,10 +36,12 @@ static struct wsgi_request *coroae_current_wsgi_req(void) {
}
}
uwsgi_log("[BUG] current_wsgi_req NOT FOUND !!!\n");
// TODO allow to survive api call error as in the python plugin
exit(1);
}
// create a new coro
SV * coroae_coro_new(CV *block) {
SV *newobj = NULL;
dSP;
@@ -179,7 +181,7 @@ edge:
wsgi_req = find_first_available_wsgi_req();
if (wsgi_req == NULL) {
uwsgi_log("async queue is full !!!\n");
uwsgi_async_queue_is_full(uwsgi_now());
goto clear;
}
+1 -1
View File
@@ -144,7 +144,7 @@ edge:
wsgi_req = find_first_available_wsgi_req();
if (wsgi_req == NULL) {
uwsgi_log("async queue is full !!!\n");
uwsgi_async_queue_is_full(uwsgi_now());
goto clear;
}
+4
View File
@@ -1956,6 +1956,8 @@ struct uwsgi_server {
int async_queue;
int async_nevents;
time_t async_queue_is_full;
int max_vars;
int vec_size;
@@ -3846,6 +3848,8 @@ int uwsgi_exceptions_catch(struct wsgi_request *);
uint64_t uwsgi_worker_exceptions(int);
struct uwsgi_exception_handler *uwsgi_register_exception_handler(char *, int (*)(struct uwsgi_exception_handler_instance *, char *, size_t));
void uwsgi_async_queue_is_full(time_t);
#define uwsgi_response_add_connection_close(x) uwsgi_response_add_header(x, "Connection", 10, "close", 5)
#define uwsgi_response_add_content_type(x, y, z) uwsgi_response_add_header(x, "Content-Type", 12, y, z)