Welcome! Log In Create A New Profile

Advanced

Re: Cancel ongoing ngx_http_request_t

May 22, 2015 09:34AM
Ok, so I managed this to work, needed to add ngx_http_send_header and ngx_http_finalize_request:

static void simple_timeout_handler(ngx_event_t* timeout_event)
{
ngx_int_t result;
ngx_http_request_t* request;

ngx_log_debug0(NGX_LOG_DEBUG_HTTP, timeout_event->log, 0,
"SIMPLE TIMEOUT TIMER END");

request = (ngx_http_request_t*)timeout_event->data;

result = ngx_http_send_header(request);
ngx_http_finalize_request(request, result);
}

Everything work fine, but during the load test, after some time, a SEGFAULT occurs:

Thread #1 [nginx] 3352 [core: 7] (Suspended : Signal : SIGSEGV:Segmentation fault)
ngx_destroy_pool() at ngx_palloc.c:51 0x405187
ngx_http_free_request() at ngx_http_request.c:3,499 0x42f04b
ngx_http_set_keepalive() at ngx_http_request.c:2,901 0x4300d1
ngx_http_finalize_connection() at ngx_http_request.c:2,538 0x4300d1
ngx_http_finalize_request() at ngx_http_request.c:2,434 0x430e41
simple_timeout_handler() at simple_timeout_module.c:135 0x44a8ef
ngx_event_expire_timers() at ngx_event_timer.c:94 0x41bf5a
ngx_process_events_and_timers() at ngx_event.c:262 0x41bb86
ngx_single_process_cycle() at ngx_process_cycle.c:308 0x423c8b
main() at nginx.c:416 0x403bc6

It seems, that pool argument passed to ngx_destroy_pool is not initialized, any ideas why this could happen?
Subject Author Posted

Cancel ongoing ngx_http_request_t

donatasm May 21, 2015 10:19AM

Re: Cancel ongoing ngx_http_request_t

donatasm May 22, 2015 09:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 83
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready