Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit b88e067

Browse files
committed
Eliminate CHECK that fails (rarely) during the IPRO lookup.
Fixes #1096
1 parent b214fb4 commit b88e067

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/ngx_base_fetch.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,13 @@ void NgxBaseFetch::ReadCallback(const ps_event_data& data) {
164164
return;
165165
}
166166

167-
CHECK(r->count > 0) << "r->count: " << r->count;
168-
169167
int rc;
170168
// If we are unlucky enough to have our connection finalized mid-ipro-lookup,
171169
// we must enter a different flow. Also see ps_in_place_check_header_filter().
172170
if ((ctx->base_fetch->base_fetch_type_ != kIproLookup)
173171
&& r->connection->error) {
174172
ngx_log_error(NGX_LOG_DEBUG, ngx_cycle->log, 0,
175-
"pagespeed [%p] request already finalized", r);
173+
"pagespeed [%p] request already finalized %d", r, r->count);
176174
rc = NGX_ERROR;
177175
} else {
178176
rc = ps_base_fetch::ps_base_fetch_handler(r);
@@ -186,8 +184,11 @@ void NgxBaseFetch::ReadCallback(const ps_event_data& data) {
186184

187185
ngx_connection_t* c = r->connection;
188186
ngx_http_finalize_request(r, rc);
189-
// See http://forum.nginx.org/read.php?2,253006,253061
190-
ngx_http_run_posted_requests(c);
187+
188+
if (!r->connection->error) {
189+
// See http://forum.nginx.org/read.php?2,253006,253061
190+
ngx_http_run_posted_requests(c);
191+
}
191192
}
192193

193194
void NgxBaseFetch::Lock() {

0 commit comments

Comments
 (0)