cloudfoundry / cloudfoundry/cloud_controller_ng

In BitsExpiration#expire_droplets!, app.droplet_guid is empty

Open
#1,277 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

See https://cloudfoundry.slack.com/archives/C07C04W4Q/p1546603546043100 for context on #capi:

TLDR: add these lines to the api cloud_controller.yml and restart:

packages:
  max_valid_packages_stored: 2

droplets:
  max_staged_droplets_stored: 2

Create an app, get its GUID, and in two windows run the following commands while repeatedly cf push APP:

watch "cf curl /v3/apps/$GUID/packages | jq -c '.resources[] | [.guid, .state, .created_at]'"

watch "cf curl /v3/apps/$GUID/droplets | jq -c '.resources[] | [.guid, .state, .created_at]'"

Notice that we always have 2 non-expired droplets but the expected 3 non-expired packages. This is because there's a current package that is excluded from expiring, but no current droplet.

In v2/push, prepare_to_stage(app) does app.update(droplet_guid: nil)

That might be why the expirer doesn't exclude that app from its calculations

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 BitsExpiration#expire_droplets! and the v2/push prepare_to_stage(app) path mentioned in the report. Reproduce with the packages and droplets retention settings in cloud_controller.yml, repeatedly push an app, and inspect the package and droplet lists with the provided cf curl commands. Done means the expirer correctly handles the current package and droplet state.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.