JosiahWI commented on code in PR #13286:
URL: https://github.com/apache/trafficserver/pull/13286#discussion_r3444791336


##########
plugins/header_rewrite/statement.cc:
##########
@@ -21,6 +21,24 @@
 //
 #include "statement.h"
 
+ts::Metrics::Counter::AtomicType *hrw_stat_operators  = nullptr;
+ts::Metrics::Counter::AtomicType *hrw_stat_conditions = nullptr;
+
+void
+init_hrw_work_stats()
+{
+  // createPtr() is idempotent and internally synchronized: it returns the 
existing counter when
+  // one already has the given name. header_rewrite.so can be loaded both 
globally (TSPluginInit)

Review Comment:
   A reader should infer from the first sentence that `createPtr` may be 
invoked twice on the init path. It is a justification for omitting a null 
guard. But there is a null guard, so the comment may cause confusion.
   
   The comment does cover the important fact, which is that the plugin may be 
loaded as both a global and a remap plugin simultaneously. I think it's not 
worth rerunning CI to reword in this case, so I'm not requesting a change.



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