cloudfoundry / cloudfoundry/cloud_controller_ng

Wrong package state calculation for aborted deployments

Open
#2,975 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

unscheduled
Dominant language
Ruby
Stars
207
Forks
373
Avg merge
2d 12h
Merged PRs (30d)
56

Description

Issue

Aborting a cf push results in wrong package_state being calculated.

Steps to Reproduce

  • push a simple app (e.g. [1])
  • re-push and abort (CTRL+C) during staging phase (Staging app and tracing logs...)

Expected result

  • cf curl "/v2/apps/:guid" shows "package_state": "STAGED"

Current result

  • cf curl "/v2/apps/:guid" shows "package_state": "PENDING"

Context

The package_state method in ProcessModel [2] uses the PackageStateCalculator [3] which assumes that for a STAGED package the desired droplet must equal the latest droplet [4]; for an aborted push this assumption is wrong.

[1] https://github.com/cloudfoundry-samples/test-app
[2] https://github.com/cloudfoundry/cloud_controller_ng/blob/932817c66ffa3c6ed1f819cd77eda7013d59afd6/app/models/runtime/process_model.rb#L197-L200
[3] https://github.com/cloudfoundry/cloud_controller_ng/blob/main/app/models/runtime/helpers/package_state_calculator.rb
[4] https://github.com/cloudfoundry/cloud_controller_ng/blob/932817c66ffa3c6ed1f819cd77eda7013d59afd6/app/models/runtime/helpers/package_state_calculator.rb#L35

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with app/models/runtime/process_model.rb and app/models/runtime/helpers/package_state_calculator.rb, then trace how package_state is calculated after an aborted cf push. Reproduce the staging interruption and check cf curl "/v2/apps/:guid". Done means an aborted push reports package_state as STAGED rather than PENDING.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.