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

get-health-check reports 1 second invocation timeout when the default is used #2311

Open
4 tasks done
mymasse opened this issue Sep 6, 2022 · 3 comments
Open
4 tasks done
Assignees

Comments

@mymasse
Copy link

mymasse commented Sep 6, 2022

Please fill out the issue checklist below and provide ALL the requested information.

  • I reviewed open and closed github issues that may be related to my problem.
  • I tried updating to the latest version of the CF CLI to see if it fixed my problem.
  • I attempted to run the command with CF_TRACE=1 to help debug the issue.
  • I am reporting a bug that others will be able to reproduce.

Describe the bug and the command you saw an issue with
While debugging why an application was being restarted by CF continuously we looked into the get-health-check of the application. The invocation timeout was listed as 1 and we believe this is wrong.

What happened
We do not set any healtcheck timeouts on our apps and rely on the default provided by CAPI which should be 60s default_health_check_timeout. Running the get-health-check actually returns 1s.

Expected behavior
We expected the command to return the correct value.

Exact Steps To Reproduce
Steps to reproduce the behavior; include the exact CLI commands and verbose output:

  1. cf push <APP> an application without specifying the healthcheck timeout.
  2. Run cf get-health-check <APP>

Provide more context

  • platform and shell details ( e.g. Mac OS X 10.11 iTerm): Ubuntu 22.04.1 LTS
  • version of the CLI you are running: cf version 8.4.0+b4c083e.2022-06-02
  • version of the CC API Release you are on: cf-for-k8s v5.7.1 and cf-deployment 21.4.0

**Possible code bug
This line in the CLI code when invocation timeout is set to 0 defaults the output of the command to 1, this seems like the problem:

invocationTimeout = 1

Notes regarding V6 and V7 CLI support:

  • V6:
    • Minimum supported version of CF Deployment: v7.0.0 (CAPI Release: 1.74.0 (APIs 2.128.0 and 3.63.0))
    • Maximum supported version of CF Deployment: v13.4.0 (CAPI Release: 1.94.0 (APIs 2.149.0 and 3.84.0))
  • V7:
    • Minimum supported version of CF Deployment: v13.5.0 (CAPI Release: 1.95.0 (APIs 2.150.0 and 3.85.0))
@gururajsh gururajsh self-assigned this Sep 27, 2024
@gururajsh
Copy link
Member

Hi @mymasse. CLI assigns the value 1 when a 0/null value is returned from cloud controller. Not sure why the default 60s is not being sent to CLI from CC. Please feel free to open an issue with CAPI.

@mymasse
Copy link
Author

mymasse commented Sep 27, 2024

Even return 0/null would be better than returning 1, at least it would point out that it's not set. I agree that CAPI should probably return the default value but I still think the CLI should return something else than 1 in this case since the CLI still needs to support older CAPI release.

@gururajsh
Copy link
Member

There are two timeouts for healthcheck. One is the default_health_check_timeout which has default of 60s as mentioned here. This is the time the health_check waits for the app to come up. The other one is health_check invocation_timeout which has a default of 1s as mentioned here. This is the time the health_check endpoint is polled to see if the app is responding or not until the defualt_time_out is elapsed. So for ex, health_check is performed for an app A every 1s upto 60s.

The reason CAPI is sending null is to differentiate if a value is set or not by the user. This has been the logic for over 6years. So supported older version of CAPI should be good.

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

No branches or pull requests

3 participants