Skip to content

Commit 2f44c63

Browse files
committed
add validation that config values are JSON objects
Signed-off-by: dancingactor <s990346@gmail.com>
1 parent 72a2462 commit 2f44c63

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ray/rpc/rpc_chaos.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ class RpcFailureManager {
8282
}
8383

8484
for (auto &[method, config] : json.items()) {
85+
if (!config.is_object()) {
86+
RAY_LOG(FATAL) << "Value for method '" << method
87+
<< "' in testing_rpc_failure config is not a JSON object: "
88+
<< config.dump();
89+
continue;
90+
}
8591
for (const auto &[config_key, _] : config.items()) {
8692
if (config_key != "num_failures" && config_key != "req_failure_prob" &&
8793
config_key != "resp_failure_prob" &&

0 commit comments

Comments
 (0)