Permalink
Browse files

MB-4334 - clear downstream timeout before releasing

There's one code path in cproxy_release_downstream() where a
cproxy_forward() fails, during a retry, possibly while the downstream
timeout_tv event is still regsitered.  In that case, a downstream
could be released that has a non-0 timeout_tv.  It's a small window
that some users have hit.

Change-Id: I1b87298dba1151c8ece51c0cd78d68ca6fa2bdb0
Reviewed-on: http://review.couchbase.org/15232
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Steve Yen <steve.yen@gmail.com>
  • Loading branch information...
1 parent 08dc908 commit cb602b1fa6112f78bf8a35347921ebbc2cc9b870 @steveyen steveyen committed Apr 26, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 cproxy.c
View
@@ -1180,6 +1180,11 @@ bool cproxy_release_downstream(downstream *d, bool force) {
}
}
+ cproxy_clear_timeout(d); // For MB-4334.
+
+ assert(d->timeout_tv.tv_sec == 0);
+ assert(d->timeout_tv.tv_usec == 0);
+
// If this downstream still has the same configuration as our top-level
// proxy config, go back onto the available, released downstream list.
//

0 comments on commit cb602b1

Please sign in to comment.