Permalink
Browse files

Don't warn if some Tier constraints fail

Summary:
A tier override can be guarded by multiple conditions, and they should
all be considered "used" even if an early one fails.

Reviewed By: mxw

Differential Revision: D7139208

fbshipit-source-id: 01a8287f4343da10045600d957d1c849c0720515
  • Loading branch information...
markw65 authored and hhvm-bot committed Mar 3, 2018
1 parent cb886f6 commit 2db3e86db48100d0d541faa1683a2cc5e0d5aa88
Showing with 6 additions and 3 deletions.
  1. +6 −3 hphp/runtime/base/runtime-option.cpp
@@ -803,9 +803,12 @@ static std::vector<std::string> getTierOverwrites(IniSetting::Map& ini,
"cpu = '{}', tiers = '{}'",
hostname, tier, cpu, tiers));
}
if (matchHdfPattern(hostname, ini, hdf, "machine") &&
matchHdfPattern(tier, ini, hdf, "tier") &&
matchHdfPattern(tiers, ini, hdf, "tiers", "m") &&
// Check the patterns using "&" rather than "&&" so they all get
// evaluated; otherwise with multiple patterns, if an earlier
// one fails to match, the later one is reported as unused.
if (matchHdfPattern(hostname, ini, hdf, "machine") &
matchHdfPattern(tier, ini, hdf, "tier") &
matchHdfPattern(tiers, ini, hdf, "tiers", "m") &
matchHdfPattern(cpu, ini, hdf, "cpu")) {
messages.emplace_back(folly::sformat(
"Matched tier: {}", hdf.getName()));

0 comments on commit 2db3e86

Please sign in to comment.