mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-08-19 03:57:21 +00:00
avoid async queue full log storming
This commit is contained in:
+9
-5
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user