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

fix: Rework delete-then-download handling in state engine #893

Merged
merged 1 commit into from
Feb 6, 2019

Conversation

CameronDiver
Copy link
Contributor

In the original implementation it was possible that the delete did not
wait for the kill step to be finished, so it would not be deleted.

We seperate this process into two steps, to allow for the container to
have stopped before proceeding.

Change-type: patch
Closes: #841
Signed-off-by: Cameron Diver cameron@balena.io

@@ -841,7 +841,10 @@ module.exports = class ApplicationManager extends EventEmitter
return @bestDeltaSource(image, available)
proxyvisorImages = @proxyvisor.imagesInUse(current, target)

imagesToRemove = _.filter availableAndUnused, (image) ->
potentialDeleteThenDownload = _.filter current.local.apps.services, (svc) ->
return svc.config.labels['io.balena.update.strategy'] == 'delete-then-download' and svc.status in ['Stopped']
Copy link

Choose a reason for hiding this comment

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

why not svc.status == 'Stopped' ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I was actually testing against ['Stopping', 'Stopped'] then I realised this was wrong, and forgot to change. Good catch!

@CameronDiver CameronDiver force-pushed the 841-delete-then-download branch 2 times, most recently from 1c4c505 to e9b51bb Compare February 6, 2019 11:39
In the original implementation it was possible that the delete did not
wait for the kill step to be finished, so it would not be deleted.

We seperate this process into two steps, to allow for the container to
have stopped before proceeding.

Change-type: patch
Closes: #841
Signed-off-by: Cameron Diver <cameron@balena.io>
@CameronDiver CameronDiver merged commit 7d25f79 into master Feb 6, 2019
@ghost ghost removed the flow/in-review label Feb 6, 2019
@CameronDiver CameronDiver deleted the 841-delete-then-download branch February 11, 2019 11:12
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.

2 participants