worker process exited on signal 11 (core dumped)

Maxim Dounin mdounin на mdounin.ru
Вт Фев 16 14:54:29 MSK 2010


Hello!

On Wed, Feb 10, 2010 at 09:42:47PM +0300, Vladimir Sopot wrote:

> 
> On Feb 10, 2010, at 3:49 PM, Maxim Dounin wrote:
> 
> >>> Ok, кажется я понял проблему.  Судя по всему memcached_pass не 
> >>> дожидается полного прилёта trailer'а ("END") и ругается.  А в 
> >>> случае keepalive остатки trailer'а долетают в ответ на следующий 
> >>> запрос.
> >>> 
> >>> По идее строка "invalid trailer" должна наблюдаться и без 
> >>> keepalive (но скорее всего реже), а "invalid response" - только 
> >>> если keepalive включён.
> >> 
> >> 50 минут - полет нормальный, 
> >> 
> >> # grep -c 'subrequests cycle while processing' error.log
> >> 22076
> >> # grep memcached error.log
> >> #
> > 
> > Видимо "реже" в данном случае вырождается в "почти никогда".
> 
> Однако, все же "почти" никогда:
> 
> # sed -n "1 p" error.log 
> 2010/02/10 16:08:53 [error] 14875#0: *282680 directory index of "/wwwroot/" is forbidden
> # grep memcached error.log
> 2010/02/10 19:13:00 [error] 7643#0: *9676423 memcached sent invalid trailer while sending to client
> 2010/02/10 19:40:46 [error] 7638#0: *11190967 memcached sent invalid trailer while sending to client
> 2010/02/10 19:44:17 [error] 7641#0: *11386082 memcached sent invalid trailer while sending to client
> 2010/02/10 19:50:40 [error] 7646#0: *11737608 memcached sent invalid trailer while sending to client
> 2010/02/10 20:31:27 [error] 14006#0: *13901259 memcached sent invalid trailer while sending to client
> 2010/02/10 21:28:42 [error] 20249#0: *16943253 memcached sent invalid trailer while sending to client

Патч.

Maxim Dounin
-------------- next part --------------
# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1266320928 -10800
# Node ID 9009f1982e02d6f0614d4ddeae0672042442775a
# Parent  09972a4975970f7c3510177b8a287283d3a53c58
Memcached: correctly handle trailer split into several packets.

With old code message "[error] ... memcached sent invalid trailer" may appear
in logs for no reason.  It doesn't cause any harm except message itself
with official nginx though may cause spurious errors on connection reuse with
upstream keepalive module.

diff --git a/src/http/modules/ngx_http_memcached_module.c b/src/http/modules/ngx_http_memcached_module.c
--- a/src/http/modules/ngx_http_memcached_module.c
+++ b/src/http/modules/ngx_http_memcached_module.c
@@ -432,15 +432,20 @@ ngx_http_memcached_filter(void *data, ss
 
         if (ngx_strncmp(b->last,
                    ngx_http_memcached_end + NGX_HTTP_MEMCACHED_END - ctx->rest,
-                   ctx->rest)
+                   bytes)
             != 0)
         {
             ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0,
                           "memcached sent invalid trailer");
+
+            u->length = 0;
+            ctx->rest = 0;
+
+            return NGX_OK;
         }
 
-        u->length = 0;
-        ctx->rest = 0;
+        u->length -= bytes;
+        ctx->rest -= bytes;
 
         return NGX_OK;
     }


Подробная информация о списке рассылки nginx-ru