Skip to content

Commit 1c6c78b

Browse files
steveyenMatt Ingenthron
authored and
Matt Ingenthron
committed
bug 2521 - avoid locks around front cache & set optimization
Check the config/behavior flags before accessing locks, as an optimization when the front cache & set optimization are configured to be off. Change-Id: If6333fc63f08bca927dedfa17bc4eaa8eb3f06bd Reviewed-on: http://review.northscale.com/2771 Tested-by: Steve Yen <[email protected]> Tested-by: Matt Ingenthron <[email protected]> Reviewed-by: Matt Ingenthron <[email protected]>
1 parent 48377d9 commit 1c6c78b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cproxy_protocol_a.c

+8
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,10 @@ void cproxy_del_front_cache_key_ascii(downstream *d,
433433
assert(d->ptd);
434434
assert(d->ptd->proxy);
435435

436+
if (d->ptd->behavior_pool.base.front_cache_lifespan == 0) {
437+
return;
438+
}
439+
436440
if (mcache_started(&d->ptd->proxy->front_cache)) {
437441
char *spc = strchr(command, ' ');
438442
if (spc != NULL) {
@@ -464,6 +468,10 @@ bool cproxy_optimize_set_ascii(downstream *d, conn *uc,
464468
assert(uc);
465469
assert(uc->next == NULL);
466470

471+
if (d->ptd->behavior_pool.base.optimize_set[0] == '\0') {
472+
return false;
473+
}
474+
467475
if (matcher_check(&d->ptd->proxy->optimize_set_matcher,
468476
key, key_len, false)) {
469477
d->upstream_conn = NULL;

0 commit comments

Comments
 (0)