This fixes state machine looping when using upstream connection throttling with parent selection#5674
Merged
jrushford merged 1 commit intoapache:masterfrom Jun 25, 2019
Conversation
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.
vmamidi
approved these changes
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) { |
Member
There was a problem hiding this comment.
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.
SolidWallOfCode
approved these changes
Jun 25, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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().