Jackie-Jiang commented on a change in pull request #4222: Add startup/shutdown
checks for HelixServerStarter
URL: https://github.com/apache/incubator-pinot/pull/4222#discussion_r286215184
##########
File path:
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixServerStarter.java
##########
@@ -337,12 +237,47 @@ private void setupHelixSystemProperties() {
// NOTE: Helix will disconnect the manager and disable the instance if it
detects flapping (too frequent disconnect
// from ZooKeeper). Setting flapping time window to a small value can
avoid this from happening. Helix ignores the
// non-positive value, so set the default value as 1.
- System.setProperty(SystemPropertyKeys.FLAPPING_TIME_WINDOW,
_helixServerConfig
-
.getString(CommonConstants.Helix.CONFIG_OF_SERVER_FLAPPING_TIME_WINDOW_MS,
- CommonConstants.Helix.DEFAULT_FLAPPING_TIME_WINDOW_MS));
+ System.setProperty(SystemPropertyKeys.FLAPPING_TIME_WINDOW,
+ _serverConf.getString(CONFIG_OF_SERVER_FLAPPING_TIME_WINDOW_MS,
DEFAULT_FLAPPING_TIME_WINDOW_MS));
+ }
+
+ /**
+ * When the server starts, check if the service status turns GOOD.
+ *
+ * @param endTimeMs Timeout for the check
+ */
+ private void startupServiceStatusCheck(long endTimeMs) {
+ LOGGER.info("Starting startup service status check");
+ long startTimeMs = System.currentTimeMillis();
+ long checkIntervalMs = _serverConf
+ .getLong(CONFIG_OF_STARTUP_SERVICE_STATUS_CHECK_INTERVAL_MS,
DEFAULT_STARTUP_SERVICE_STATUS_CHECK_INTERVAL_MS);
+
+ while (System.currentTimeMillis() < endTimeMs) {
+ Status serviceStatus = ServiceStatus.getServiceStatus();
Review comment:
Agree.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]