Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure envoy health check period form director #153

Conversation

aleksandr-mokrov
Copy link
Contributor

Configure envoy health check period form director.
Ability to set a envoy health check period (envoy_health_check_period) in director_config.yaml.


shard_info['is_online']: True
shard_info['is_experiment_running'] = is_experiment_running
shard_info['valid_duration'] = valid_duration
shard_info['last_updated'] = time.time()
hc_period = self.settings.get('envoy_health_check_period', ENVOY_HEALTH_CHECK_PERIOD)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have 2 variables here: hc_period and valid_duration and they always have the same relation y = 2*x.
So could we remove one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valid_duration - this variable is sent by the envoy and means how long the sent information can be considered valid
health_check_period - the director sends this variable to the envoy to configure. It's possible to change its value during the life of the service and, because of this, valid_duration depends on the preciously set value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was refactored

@aleksandr-mokrov aleksandr-mokrov force-pushed the Envoy-health-check-timout-settings branch from 605f78c to 344f68b Compare August 17, 2021 13:21
@@ -16,13 +16,23 @@

logger = logging.getLogger(__name__)

ENVOY_HEALTH_CHECK_PERIOD = 60 # in seconds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have defaul director.yaml could we get this patam from it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter can be removed from director.yaml by user. What is the default value in this case?

)
time.sleep(DEFAULT_TIMEOUT_IN_SECONDS / 2)
time.sleep(timeout if timeout < new_timeout else new_timeout)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use min() here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was removed

Comment on lines 91 to 95
new_timeout = self.director_client.send_health_check(
collaborator_name=self.name,
is_experiment_running=self.is_experiment_running,
valid_duration=timeout * 2
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really required to change health check timeout?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was refactored.

@dmitryagapov dmitryagapov added the enhancement New feature or request label Aug 18, 2021
@alexey-gruzdev alexey-gruzdev merged commit cd4947d into securefederatedai:develop Aug 23, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants