Skip to content

Commit 9fa518f

Browse files
committed
now we skip NULL chains in our output filters and also removed the SUBREQUEST_IN_MEMORY flag for our srcache_store subrequests because it will cause mysterious hanging issues when memcached returns CLIENT_ERROR for "get".
1 parent 1baca38 commit 9fa518f

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

src/ngx_http_srcache_filter_module.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ ngx_http_srcache_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
285285

286286
dd_enter();
287287

288+
if (in == NULL) {
289+
return ngx_http_next_body_filter(r, NULL);
290+
}
291+
288292
ctx = ngx_http_get_module_ctx(r, ngx_http_srcache_filter_module);
289293

290294
if (ctx == NULL || ctx->from_cache) {
@@ -346,7 +350,7 @@ ngx_http_srcache_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
346350
}
347351

348352
if (ctx->store_response) {
349-
dd("storing the response");
353+
dd("storing the response: %p", in);
350354

351355
last = 0;
352356

@@ -1065,7 +1069,6 @@ ngx_http_srcache_store_subrequest(ngx_http_request_t *r,
10651069

10661070
ngx_http_srcache_parsed_request_t *parsed_sr;
10671071

1068-
10691072
dd_enter();
10701073
dd("store subrequest");
10711074

@@ -1143,11 +1146,14 @@ ngx_http_srcache_store_subrequest(ngx_http_request_t *r,
11431146
dd("store args: %.*s", (int) parsed_sr->args.len,
11441147
parsed_sr->args.data);
11451148

1146-
flags |= NGX_HTTP_SUBREQUEST_IN_MEMORY;
1149+
#if 0
1150+
flags |= NGX_HTTP_SUBREQUEST_IN_MEMORY|NGX_HTTP_SUBREQUEST_WAITED;
1151+
#endif
11471152

11481153
if (r->parent == NULL) {
11491154
rc = ngx_http_subrequest(r, &parsed_sr->location, &parsed_sr->args,
11501155
&sr, NULL, flags);
1156+
11511157
} else {
11521158
rc = ngx_http_subrequest(r->parent, &parsed_sr->location, &parsed_sr->args,
11531159
&sr, NULL, flags);

util/build.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@ fi
2121
#cp $root/../no-pool-nginx/nginx-$version-no_pool.patch ./ || exit 1
2222
#patch -p0 < nginx-$version-no_pool.patch || exit 1
2323

24-
if [ -n "$2" ]; then
25-
cd nginx-$version-$2/
26-
else
27-
cd nginx-$version/
28-
fi
24+
cd nginx-$version/
2925

3026
if [[ "$BUILD_CLEAN" -eq 1 || ! -f Makefile || "$root/config" -nt Makefile || "$root/util/build.sh" -nt Makefile ]]; then
31-
./configure --prefix=/opt/nginx \
27+
./configure --prefix=$root/work/nginx \
3228
--without-mail_pop3_module \
3329
--without-mail_imap_module \
3430
--without-mail_smtp_module \
@@ -57,11 +53,11 @@ if [[ "$BUILD_CLEAN" -eq 1 || ! -f Makefile || "$root/config" -nt Makefile || "$
5753
#--without-http_ssi_module # we cannot disable ssi because echo_location_async depends on it (i dunno why?!)
5854

5955
fi
60-
if [ -f /opt/nginx/sbin/nginx ]; then
61-
rm -f /opt/nginx/sbin/nginx
56+
if [ -f $root/work/nginx/sbin/nginx ]; then
57+
rm -f $root/work/nginx/sbin/nginx
6258
fi
63-
if [ -f /opt/nginx/logs/nginx.pid ]; then
64-
kill `cat /opt/nginx/logs/nginx.pid`
59+
if [ -f $root/work/nginx/logs/nginx.pid ]; then
60+
kill `cat $root/work/nginx/logs/nginx.pid`
6561
fi
6662
make -j3
6763
make install

0 commit comments

Comments
 (0)