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

Adds delaySeconds field to healthchecks #306

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cihangirbesiktas
Copy link

No description provided.

Copy link
Collaborator

@timoreimann timoreimann left a comment

Choose a reason for hiding this comment

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

Is this parameter documented somewhere? I can't find much about it.

health.go Outdated
@@ -80,6 +81,7 @@ func NewDefaultHealthCheck() *HealthCheck {
GracePeriodSeconds: 30,
IntervalSeconds: 10,
TimeoutSeconds: 5,
DelaySeconds: 15,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd rather not extend the default health check unless there's a really good reason to. IMHO, users should pick proper values on their own.

Copy link
Author

Choose a reason for hiding this comment

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

In marathon api https://mesosphere.github.io/marathon/api-console/index.html, you can find the parameter under Types->app.health.AppHealthCheck and the default value is 15. And we are using this variable in our DC/OS cluster.

Copy link
Collaborator

@timoreimann timoreimann Aug 8, 2017

Choose a reason for hiding this comment

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

Thanks for the pointer.

Shouldn't Marathon pick the default if delaySeconds is omitted from the API request?

Copy link
Author

Choose a reason for hiding this comment

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

yes, but we would like to be able to change it. And we could have some app definitions that include delaySeconds and we would like to support them.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, I did not mean to say that we should not support the parameter (we definitely should). I'm just not sure if we should extend NewDefaultHealthCheck(). It looks like you could define a custom value for DelaySeconds by creating a health check (either an empty one or based off of NewDefaultHealthCheck) and set the value accordingly?

Copy link
Author

Choose a reason for hiding this comment

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

I think Marathon API's default value of 15 which I give as a default in NewDefaultHealthCheck() should be allright.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would also prefer to not have it set by default. Without setting it in this client library here, we leave it to the Marathon server to change the default value without us requiring a change. AFAICS we don't loose anything through this, but gain a small little bit more resiliency against future Marathon updates. WDYT?

@timoreimann
Copy link
Collaborator

The tests are currently failing.

residency.go Outdated
@@ -0,0 +1,35 @@
/*
Copyright 2014 Rohith All rights reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should say 2017.

@cihangirbesiktas
Copy link
Author

Removed residency since it is on another PR and made the tests pass. Could you approve and merge @timoreimann ?

@timoreimann
Copy link
Collaborator

timoreimann commented Aug 14, 2017

@cihangirbesiktas as expressed by myself and @marco-jantke, extending NewDefaultHealthCheck doesn't seem necessary: We apparently gain nothing nothing from it for now as we chose the current Marathon default value for delaySeconds, but we risk diverging from potential changes that may happen in the future.

If you think there's a good reason to keep it, I'd be grateful for an explanation. Otherwise, I'd prefer to see that part getting removed.

@timoreimann
Copy link
Collaborator

We should have one small test somewhere that verifies we can properly deserialize the test data JSON that you have extended by the new field.

@cihangirbesiktas
Copy link
Author

What kind of test are you expecting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants