This change solves issue #3780.
After stopping an app, cloud controller immediately returns state DOWN when calling GET /v3/apps/:guid/processes/:type/stats even if the app is still in graceful shutdown period. The goal is to not simply to report DOWN for an app instance when the desired LRP is not found but it should request the actual LRP additionally to determine the instance state.
A short explanation of the proposed change:
If no running instance is found, instead of just returning state DOWN, now there is a check for the actual LRP state and if there is an actual LRP, state will be set to STOPPING.
An explanation of the use cases your change solves
After stopping an app, cloud controller will return state STOPPING when calling GET /v3/apps/:guid/processes/:type/stats as long as the app is still in graceful shutdown period and there exists still an actual LRP.
This change solves issue #3780. After stopping an app, cloud controller immediately returns state
DOWN
when callingGET /v3/apps/:guid/processes/:type/stats
even if the app is still in graceful shutdown period. The goal is to not simply to reportDOWN
for an app instance when the desired LRP is not found but it should request the actual LRP additionally to determine the instance state.A short explanation of the proposed change: If no running instance is found, instead of just returning state
DOWN
, now there is a check for the actual LRP state and if there is an actual LRP, state will be set toSTOPPING
.An explanation of the use cases your change solves After stopping an app, cloud controller will return state
STOPPING
when callingGET /v3/apps/:guid/processes/:type/stats
as long as the app is still in graceful shutdown period and there exists still an actual LRP.[X] I have reviewed the contributing guide
[X] I have viewed, signed, and submitted the Contributor License Agreement
[X] I have made this pull request to the
main
branch[X] I have run all the unit tests using
bundle exec rake
[ ] I have run CF Acceptance Tests