@@ -124,8 +124,8 @@ PREREQS_ERROR_MSGS = {
124
124
' please free the port and restart the node.' ,
125
125
'ycql_metric_port' : 'YCQL metrics port {} is already in use. For accessing the YCQL metrics,' \
126
126
' please free the port and restart the node.' ,
127
- 'clockbound' : 'Clockbound is recommended on AWS clusters. It can reduce read restart errors ' \
128
- ' significantly in concurrent workloads.' \
127
+ 'clockbound' : 'Clockbound is recommended on AWS/Azure/GCP clusters.' \
128
+ ' It can reduce read restart errors significantly in concurrent workloads.' \
129
129
' Relevant flag: --enhance_time_sync_via_clockbound.' ,
130
130
}
131
131
QUICK_START_LINKS = {
@@ -671,31 +671,19 @@ def using_time_sync_service():
671
671
allow_list = ['169.254.169.123' , 'metadata.google.internal' , 'PHC' ,
672
672
'aws.com' , 'google.com' ]
673
673
674
- try :
675
- # Run the chronyc sources command and capture the output
676
- result = subprocess .run (['chronyc' , 'sources' ], capture_output = True , text = True , timeout = 1 )
677
-
678
- # Check if any allowed source is in the output
679
- if result .returncode == 0 :
680
- for source in allow_list :
681
- if source in result .stdout :
682
- return True
683
- except (subprocess .TimeoutExpired , FileNotFoundError ):
684
- return False
674
+ cmd = ['chronyc' , 'sources' ]
675
+ out , err , ret_code = run_process (cmd , timeout = 1 , log_cmd = True )
676
+ if ret_code == 0 :
677
+ for source in allow_list :
678
+ if source in out :
679
+ return True
685
680
686
681
return False
687
682
688
683
def is_phc_configured ():
689
- try :
690
- # Run the chronyc sources command and capture the output
691
- result = subprocess .run (['systemctl' , 'status' , 'clockbound' ],
692
- capture_output = True , text = True , timeout = 1 )
693
-
694
- # Check if PHC is in the output
695
- if result .returncode == 0 and 'PHC' in result .stdout :
696
- return True
697
- except (subprocess .TimeoutExpired , FileNotFoundError ):
698
- return False
684
+ cmd = ['systemctl' , 'status' , 'clockbound' ]
685
+ out , err , retcode = run_process (cmd , timeout = 1 , log_cmd = True )
686
+ return retcode == 0 and 'PHC' in out
699
687
700
688
class ControlScript (object ):
701
689
def __init__ (self ):
@@ -2800,11 +2788,12 @@ class ControlScript(object):
2800
2788
prereqs_warn .add ('ntp/chrony' )
2801
2789
prereqs_warn_flag = True
2802
2790
2803
- # Configuring clockbound is strongly recommended for AWS clusters.
2804
- if has_aws_time_sync_service () and not self .configs .temp_data [
2805
- "enhance_time_sync_via_clockbound" ]:
2806
- prereqs_warn .add ('clockbound' )
2807
- prereqs_warn_flag = True
2791
+ # TODO: Uncomment this block when clockbound becomes GA.
2792
+ # # Configuring clockbound is strongly recommended for AWS clusters.
2793
+ # if using_time_sync_service() and not self.configs.temp_data[
2794
+ # "enhance_time_sync_via_clockbound"]:
2795
+ # prereqs_warn.add('clockbound')
2796
+ # prereqs_warn_flag = True
2808
2797
2809
2798
(failed_ports , warning_ports , mandatory_port_available ,
2810
2799
recommended_port_available ) = self .check_ports ()
@@ -4091,18 +4080,14 @@ class ControlScript(object):
4091
4080
Output .init_animation ("Validating system config for clockbound..." )
4092
4081
configure_clockbound_path = find_binary_location ("configure_clockbound.sh" )
4093
4082
cmd = ["bash" , configure_clockbound_path , "--validate" ]
4094
- try :
4095
- subprocess .check_call (cmd )
4096
- Output .update_animation ("Clockbound configured successfully." )
4097
- except subprocess .CalledProcessError as e :
4098
- exit_code = e .returncode
4099
- Output .update_animation ("Failed to validate clockbound configuration." ,
4083
+ out , err , retcode = run_process (cmd )
4084
+ if retcode == 0 :
4085
+ Output .update_animation ("System configured for clockbound." )
4086
+ else :
4087
+ Output .update_animation ("Failed to validate system configuration for clockbound." ,
4100
4088
status = Output .ANIMATION_FAIL )
4101
4089
Output .log_error_and_exit (
4102
- Output .make_red ("ERROR" ) + f": Exit code: { exit_code } ."
4103
- " Did you run configure_clockbound.sh script?"
4104
- )
4105
-
4090
+ Output .make_red ("ERROR" ) + ": Did you run configure_clockbound.sh script?" )
4106
4091
4107
4092
# Runs post_install script for linux computers.
4108
4093
def post_install_yb (self ):
0 commit comments