@@ -81,23 +81,34 @@ class RpcFailureManager {
8181 return ;
8282 }
8383
84- for (auto &[key, value] : json.items ()) {
84+ for (auto &[method, config] : json.items ()) {
85+ for (const auto &[config_key, _] : config.items ()) {
86+ if (config_key != " num_failures" && config_key != " req_failure_prob" &&
87+ config_key != " req_failure_prob" && config_key != " resp_failure_prob" &&
88+ config_key != " in_flight_failure_prob" &&
89+ config_key != " num_lower_bound_req_failures" &&
90+ config_key != " num_lower_bound_resp_failures" &&
91+ config_key != " num_lower_bound_in_flight_failures" ) {
92+ RAY_LOG (FATAL) << " Unknown key specified in testing_rpc_failure config: "
93+ << config_key;
94+ }
95+ }
8596 auto [iter, _] = failable_methods_.emplace (
86- key ,
97+ method ,
8798 Failable{
88- value .value (" num_failures" , 0L ),
89- value .value (" req_failure_prob" , 0UL ),
90- value .value (" resp_failure_prob" , 0UL ),
91- value .value (" in_flight_failure_prob" , 0UL ),
92- value .value (" num_lower_bound_req_failures" , 0UL ),
93- value .value (" num_lower_bound_resp_failures" , 0UL ),
94- value .value (" num_lower_bound_in_flight_failures" , 0UL ),
99+ config .value (" num_failures" , 0L ),
100+ config .value (" req_failure_prob" , 0UL ),
101+ config .value (" resp_failure_prob" , 0UL ),
102+ config .value (" in_flight_failure_prob" , 0UL ),
103+ config .value (" num_lower_bound_req_failures" , 0UL ),
104+ config .value (" num_lower_bound_resp_failures" , 0UL ),
105+ config .value (" num_lower_bound_in_flight_failures" , 0UL ),
95106 });
96107 const auto &failable = iter->second ;
97108 RAY_CHECK_LE (failable.req_failure_prob + failable.resp_failure_prob +
98109 failable.in_flight_failure_prob ,
99110 100UL );
100- if (key == " *" ) {
111+ if (method == " *" ) {
101112 wildcard_set_ = true ;
102113 // The wildcard overrides all other method configurations.
103114 break ;
0 commit comments