bneradt commented on a change in pull request #6931:
URL: https://github.com/apache/trafficserver/pull/6931#discussion_r444454739



##########
File path: src/traffic_server/traffic_server.cc
##########
@@ -173,10 +174,23 @@ static int poll_timeout         = -1; // No value set.
 static int cmd_disable_freelist = 0;
 static bool signal_received[NSIG];
 
-// 1: delay listen, wait for cache.
-// 0: Do not delay, start listen ASAP.
+/// We use the following two variables to gate the emission of the "traffic
+/// server initialized" log message. This message can be helpful for users who
+/// want to know that Traffic Server is not just running but has had its cache
+/// initialized and has called accept() on its ports.
+
+/// The sockets are not only created, but traffic server has set our socket
+/// options on them, plugins have configured them as desired, and traffic
+/// server has called accept on them.
+static std::atomic<bool> ports_are_ready = false;
+
+/// Cache initialization has completed.
+static std::atomic<bool> cache_is_initialized = false;
+
+// 1: the main thread delayed accepting, start accepting.
+// 0: delay accept, wait for cache initialization.
 // -1: cache is already initialized, don't delay.
-static int delay_listen_for_cache_p;
+static int delay_listen_for_cache_p = 0;

Review comment:
       Makes sense.




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

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


Reply via email to