bugfix: applied the cache_lock_hang_in_subreq patch to the nginx core to fix the request hang when using proxy_cache_lock in subrequests and the cache lock timeout happens.

pull/35/head
Yichun Zhang (agentzh) 11 years ago
parent 4308a5ca45
commit 1df484be52

@ -0,0 +1,22 @@
--- nginx-1.4.3/src/http/ngx_http_file_cache.c 2013-10-08 05:07:14.000000000 -0700
+++ nginx-1.4.3-patched/src/http/ngx_http_file_cache.c 2013-10-26 14:47:56.184041728 -0700
@@ -432,6 +432,7 @@ ngx_http_file_cache_lock_wait_handler(ng
ngx_uint_t wait;
ngx_msec_t timer;
ngx_http_cache_t *c;
+ ngx_connection_t *conn;
ngx_http_request_t *r;
ngx_http_file_cache_t *cache;
@@ -471,7 +472,10 @@ wakeup:
c->waiting = 0;
r->main->blocked--;
- r->connection->write->handler(r->connection->write);
+
+ conn = r->connection;
+ r->write_event_handler(r);
+ ngx_http_run_posted_requests(conn);
}

@ -175,22 +175,26 @@ fi
answer=`$root/util/ver-ge "$main_ver" 1.5.3` answer=`$root/util/ver-ge "$main_ver" 1.5.3`
if [ "$answer" = "N" ]; then if [ "$answer" = "N" ]; then
echo "$info_txt applying the unix_socket_accept_over_read patch for lua $ver" echo "$info_txt applying the unix_socket_accept_over_read patch for nginx $ver"
patch -p1 < $root/patches/nginx-$ver-unix_socket_accept_over_read.patch || exit 1 patch -p1 < $root/patches/nginx-$ver-unix_socket_accept_over_read.patch || exit 1
echo echo
fi fi
answer=`$root/util/ver-ge "$main_ver" 1.5.3` answer=`$root/util/ver-ge "$main_ver" 1.5.3`
if [ "$answer" = "N" ]; then if [ "$answer" = "N" ]; then
echo "$info_txt applying the gzip_buffered_bug patch for lua $ver" echo "$info_txt applying the gzip_buffered_bug patch for nginx $ver"
patch -p1 < $root/patches/nginx-$ver-gzip_buffered_bug.patch || exit 1 patch -p1 < $root/patches/nginx-$ver-gzip_buffered_bug.patch || exit 1
echo echo
fi fi
echo "$info_txt applying the gzip_flush_bug patch for lua $ver" echo "$info_txt applying the gzip_flush_bug patch for nginx $ver"
patch -p1 < $root/patches/nginx-$ver-gzip_flush_bug.patch || exit 1 patch -p1 < $root/patches/nginx-$ver-gzip_flush_bug.patch || exit 1
echo echo
echo "$info_txt applying the cache_lock_hang_in_subreq patch for nginx $ver"
patch -p1 < $root/patches/nginx-$ver-cache_lock_hang_in_subreq.patch || exit 1
echo
rm -f *.patch || exit 1 rm -f *.patch || exit 1
cd .. || exit 1 cd .. || exit 1

Loading…
Cancel
Save