Permalink
Browse files

fixed the send query timeout for real this time. the regression was c…

…aused by our "set names" hack.
  • Loading branch information...
1 parent ed90d96 commit 79c11387a8f325ce48cf9c5a70c33b69d4ef0820 @agentzh agentzh committed Oct 26, 2010
Showing with 5 additions and 11 deletions.
  1. +1 −7 src/ngx_http_drizzle_processor.c
  2. +4 −4 test/t/timeout.t
@@ -198,12 +198,6 @@ ngx_http_upstream_drizzle_send_query(ngx_http_request_t *r,
ngx_del_timer(c->write);
}
- if (c->read->timer_set) {
- ngx_del_timer(c->read);
- }
-
- ngx_add_timer(c->read, dp->loc_conf->recv_cols_timeout);
-
if (ret != DRIZZLE_RETURN_OK) {
#if 1
if (ret == DRIZZLE_RETURN_ERROR_CODE) {
@@ -263,7 +257,7 @@ ngx_http_upstream_drizzle_send_query(ngx_http_request_t *r,
c->log->action = "connecting to drizzle upstream";
dp->has_set_names = 1;
- dp->state = state_db_send_query;
+ dp->state = state_db_idle;
return ngx_http_upstream_drizzle_send_query(r, c, dp, dc);
}
View
@@ -88,18 +88,18 @@ GET /upstream
--- config
#drizzle_connect_timeout 1;
- #drizzle_send_query_timeout 10ms;
- drizzle_recv_cols_timeout 10ms;
+ drizzle_send_query_timeout 10ms;
+ #drizzle_recv_cols_timeout 10ms;
#drizzle_recv_rows_timeout 10ms;
location /upstream {
drizzle_pass backend;
drizzle_module_header off;
- drizzle_query 'select sleep(1)';
+ drizzle_query 'select sleep(2)';
}
--- request
GET /upstream
--- error_code: 504
--- response_body_like: 504 Gateway Time-out
---- timeout: 3
+--- timeout: 1

0 comments on commit 79c1138

Please sign in to comment.