You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bn...@apache.org on 2023/05/31 20:26:22 UTC
[trafficserver] branch strat_rec updated (0bcd5d8ef0 -> b0ba448f8b)
This is an automated email from the ASF dual-hosted git repository.
bnolsen pushed a change to branch strat_rec
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
discard 0bcd5d8ef0 internal strategies set rec to extApiParent to make ParentResult::is_some work
new b0ba448f8b fix or strategies abort where ParentResult rec isn't being set (not used by strategies)
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (0bcd5d8ef0)
\
N -- N -- N refs/heads/strat_rec (b0ba448f8b)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../experimental/parent_select/parent_select.cc | 26 +++++++++++++---------
proxy/ParentSelection.h | 4 ++--
proxy/http/remap/NextHopConsistentHash.cc | 1 -
proxy/http/remap/NextHopRoundRobin.cc | 1 -
proxy/http/remap/NextHopSelectionStrategy.h | 1 +
5 files changed, 19 insertions(+), 14 deletions(-)
[trafficserver] 01/01: fix or strategies abort where ParentResult rec isn't being set (not used by strategies)
Posted by bn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bnolsen pushed a commit to branch strat_rec
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit b0ba448f8bc3026662de4ba2bbe44e0cdfe39ac2
Author: Brian Olsen <bo...@comcast.com>
AuthorDate: Wed May 31 20:26:01 2023 +0000
fix or strategies abort where ParentResult rec isn't being set (not used by strategies)
---
.../experimental/parent_select/parent_select.cc | 26 +++++++++++++---------
proxy/ParentSelection.h | 4 ++--
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/plugins/experimental/parent_select/parent_select.cc b/plugins/experimental/parent_select/parent_select.cc
index 0408ac39e8..0c7d1d08e9 100644
--- a/plugins/experimental/parent_select/parent_select.cc
+++ b/plugins/experimental/parent_select/parent_select.cc
@@ -273,29 +273,35 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char *errbuff, int errbuff
const char *remap_from = argv[0];
const char *remap_to = argv[1];
- const char *config_file_path = argv[2];
+ std::string config_file_path = argv[2];
const char *strategy_name = argv[3];
- TSDebug(PLUGIN_NAME, "%s %s Loading parent selection strategy file %s for strategy %s", remap_from, remap_to, config_file_path,
- strategy_name);
- auto file_strategies = createStrategiesFromFile(config_file_path);
+ if (config_file_path[0] != '/') {
+ config_file_path.assign(TSConfigDirGet());
+ config_file_path.append("/");
+ config_file_path.append(argv[2]);
+ }
+
+ TSDebug(PLUGIN_NAME, "%s %s Loading parent selection strategy file %s for strategy %s", remap_from, remap_to,
+ config_file_path.c_str(), strategy_name);
+ auto file_strategies = createStrategiesFromFile(config_file_path.c_str());
if (file_strategies.size() == 0) {
- TSError("[%s] %s %s Failed to parse configuration file %s", PLUGIN_NAME, remap_from, remap_to, config_file_path);
+ TSError("[%s] %s %s Failed to parse configuration file %s", PLUGIN_NAME, remap_from, remap_to, config_file_path.c_str());
return TS_ERROR;
}
- TSDebug(PLUGIN_NAME, "'%s' '%s' successfully created strategies in file %s num %d", remap_from, remap_to, config_file_path,
- int(file_strategies.size()));
+ TSDebug(PLUGIN_NAME, "'%s' '%s' successfully created strategies in file %s num %d", remap_from, remap_to,
+ config_file_path.c_str(), int(file_strategies.size()));
auto new_strategy = file_strategies.find(strategy_name);
if (new_strategy == file_strategies.end()) {
TSDebug(PLUGIN_NAME, "'%s' '%s' TSRemapNewInstance strategy '%s' not found in file '%s'", remap_from, remap_to, strategy_name,
- config_file_path);
+ config_file_path.c_str());
return TS_ERROR;
}
TSDebug(PLUGIN_NAME, "'%s' '%s' TSRemapNewInstance successfully loaded strategy '%s' from '%s'.", remap_from, remap_to,
- strategy_name, config_file_path);
+ strategy_name, config_file_path.c_str());
// created a raw pointer _to_ a shared_ptr, because ih needs a raw pointer.
// The raw pointer in ih will be deleted in TSRemapDeleteInstance,
@@ -307,7 +313,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char *errbuff, int errbuff
TSMgmtString result;
const char *var_name = "proxy.config.url_remap.filename";
TSMgmtStringGet(var_name, &result);
- TSMgmtConfigFileAdd(result, config_file_path);
+ TSMgmtConfigFileAdd(result, config_file_path.c_str());
return TS_SUCCESS;
}
diff --git a/proxy/ParentSelection.h b/proxy/ParentSelection.h
index 8cd613f88c..1a2a7f9d1b 100644
--- a/proxy/ParentSelection.h
+++ b/proxy/ParentSelection.h
@@ -215,11 +215,11 @@ struct ParentResult {
bool
is_some() const
{
- if (rec == nullptr) {
+ if (nullptr == rec && nullptr == hostname) {
// If we don't have a result, we either haven't done a parent
// lookup yet (PARENT_UNDEFINED), or the lookup didn't match
// anything (PARENT_DIRECT).
- ink_assert(result == PARENT_UNDEFINED || result == PARENT_DIRECT);
+ ink_assert(result == PARENT_UNDEFINED || result == PARENT_DIRECT || result == PARENT_FAIL);
return false;
}