Skip to content

This fixes state machine looping when using upstream connection throttling with parent selection#5674

Merged
jrushford merged 1 commit intoapache:masterfrom
jrushford:master_parent_congestion
Jun 25, 2019
Merged

This fixes state machine looping when using upstream connection throttling with parent selection#5674
jrushford merged 1 commit intoapache:masterfrom
jrushford:master_parent_congestion

Conversation

@jrushford
Copy link
Copy Markdown
Contributor

@jrushford jrushford commented Jun 25, 2019

Fixes #5642 when using upstream connection throttling with parent selection.

Parent Selection may be used to provide redundancy and load balancing to origin servers. If upstream connection throttling is used on these origins, a state machine loop can occur that leads to a crash as the parent selection handlers did not handle this congestion connection throttling. This patch adds congestion connection throttling to the HttpSM parent handler,handle_response_from_parent().

a parent proxy exceeds proxy.config.http.per_server.connection.max
a state machine loop will occur when using parent selection to
select a parent for redundancy and/or load balancing.

The parent selection handling in the state machine did not
handle the where the number of connections to a parent is
exceeds when using throttling by setting
proxy.config.http.per_server.connection.max.  This will
lead to state machine looping and a crash when the stack is overflowed due to the
looping.  Now this is handled by either trying a new uncongested
origin or sending a negative 503 response if all available
origins are congested.
@jrushford jrushford added this to the 9.0.0 milestone Jun 25, 2019
@jrushford jrushford requested a review from vmamidi June 25, 2019 17:15
@jrushford jrushford self-assigned this Jun 25, 2019
} else if (s->method == HTTP_WKSIDX_CONNECT && s->http_config_param->disable_ssl_parenting) {
s->parent_params->findParent(&s->request_data, &s->parent_result, s->txn_conf->parent_fail_threshold,
s->txn_conf->parent_retry_time);
if (s->parent_result.result == PARENT_SPECIFIED) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably this is initialized to a reasonable value, so the this check is valid despite possibly having to update the value in the else class? I wonder if findParent should just check its second argument and do the right thing in that case. Would it be too challenging to keep s->parent_result.result correct? Although it seems you already have that problem here.

@jrushford jrushford merged commit 0fb0657 into apache:master Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Origin_max_connections can create state machine loops when hitting max

3 participants