Skip to content

Commit

Permalink
MB-4334 - clear downstream timeout before releasing
Browse files Browse the repository at this point in the history
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
steveyen committed Apr 26, 2012
1 parent 08dc908 commit cb602b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cproxy.c
Expand Up @@ -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.
//
Expand Down

0 comments on commit cb602b1

Please sign in to comment.