sinhaparth5 opened a new pull request, #13600:
URL: https://github.com/apache/trafficserver/pull/13600

   `SniSelector::yamlParser()` guarded only `YAML::LoadFile`, so a malformed 
value
   threw out of the function. On `traffic_ctl config reload` that unwinds into 
the
   event loop from the management update continuation and terminates a running
   server, bypassing the `else` branch that exists to log the failure and keep 
the
   previous configuration.
   
   The parsing moves into `parseYamlFile()` and `yamlParser()` becomes the
   exception boundary, so a bad config is rejected and the running one kept.
   
   It also checks for the `sni` key before reading it. `sni["sni"].IsSequence()`
   throws `YAML::InvalidNode` on the const node, so a selector entry without an
   `sni` key never reached the "selector node is not a map or without a name"
   error that is already there for it.
   
   The `percentage` documentation gave the default as `0.9`, but the parser 
reads
   an integer and the default is `90`. The documented value is one of the ones
   that throws, so the docs are corrected as well.
   
   ### Testing
   
   New autest `rate_limit_yaml_reload` covers both shapes: a selector entry 
with no
   `sni` key, and a fractional `percentage`.
   
   Run against the plugin built without this change, ATS dies on the first
   malformed reload. The reload command itself reports success, because the 
plugin
   callback is dispatched fire-and-forget on `ET_TASK`, and then the health 
check
   returns `000`, the JSONRPC socket refuses connections, and `diags.log` stops
   mid-reload with no FATAL and no shutdown.
   
   With this change the test passes: both configs are rejected, the errors are
   logged, and ATS keeps serving. All 7 rate_limit autests pass.
   
   Fixes: #13598
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to