brbzull0 commented on code in PR #13904:
URL: https://github.com/apache/trafficserver/pull/13904#discussion_r4376347132


##########
include/mgmt/config/ConfigContext.h:
##########
@@ -213,9 +218,12 @@ class ConfigContext
   /// Set reload directives. Only ConfigRegistry should call this during 
reload setup.
   void set_reload_directives(YAML::Node node);
 
+  /// Supplied YAML and reload directives, shared by every copy of this 
context.

Review Comment:
   Reworded: copies and dependents share the payload, and the setters replace 
it instead of changing it. The comment above `Payload` in `ConfigContext.cc` 
said the same thing and now matches.
   



##########
src/records/unit_tests/test_ConfigRegistry.cc:
##########
@@ -309,3 +314,130 @@ TEST_CASE("ConfigRegistry is_reloadable distinguishes 
handler-less entries", "[c
   // An unknown key is not reloadable.
   CHECK_FALSE(reg.is_reloadable("test_reloadable_unknown_xyz"));
 }
+
+// ─── ConfigContext content on the execute_reload() path 
───────────────────────
+//
+// No reload is in progress here, so execute_reload() hands the handler a 
task-less
+// context, and the RPC-supplied content is still applied to it.
+
+namespace
+{
+ConfigContext
+reload_with(std::string const &key, YAML::Node const &content)
+{
+  // emplace/reset, not assignment: copy-assignment is what one of the tests 
below checks.

Review Comment:
   The comment now gives the reason: copy-assignment has its own test, so the 
helper avoids it and only copy-constructs and destroys contexts.
   



##########
src/records/unit_tests/test_ConfigReloadProgress.cc:
##########
@@ -1,6 +1,7 @@
 /** @file
 
-  Unit tests for the ConfigReloadProgress checker's ownership of its reload 
task
+  Unit tests for the ConfigReloadProgress checker's ownership of its reload 
task, and
+  for ConfigContext behaviour that needs a live reload

Review Comment:
   Changed to "behavior".
   



-- 
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