Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

fleetctl: fleetctl load stops already scheduled unit #1428

Open
kayrus opened this issue Feb 9, 2016 · 2 comments
Open

fleetctl: fleetctl load stops already scheduled unit #1428

kayrus opened this issue Feb 9, 2016 · 2 comments

Comments

@kayrus
Copy link
Contributor

kayrus commented Feb 9, 2016

/cc @jonboulle @tixxdz

Steps to reproduce:

  • create unit file app.service:
[Service]
ExecStart=/usr/bin/bash -c 'while true; do echo hello1; sleep 1; done'
  • start it: fleetctl start app
  • modify local app.service: sed -i 's#hello1#hello2#g' app.service
  • load it: fleetctl load app ->
$ fleetctl load app.service 
WARNING: Unit app.service in registry differs from local unit file app.service
Unit app.service loaded on 659caee1.../coreos1

And this unit will be stopped.

Have to review lazyLoadUnits https://github.com/coreos/fleet/blob/master/fleetctl/fleetctl.go#L705

And it should be much smarter, i.e. like lazyCreateUnits one https://github.com/coreos/fleet/blob/master/fleetctl/fleetctl.go#L597

In addition we have to create unit tests for this behavior.

@guilhem
Copy link

guilhem commented Feb 12, 2016

This behavior is also a problem when using Global=true. If load doesn't stop, it can be used for a manual rolling upgrade:

  • start globalUnit (Filev1)
  • update Filev1 -> Filev2
  • load globalUnit (Filev2)
  • rolling upgrade:
    • ssh machine1 "systemctl restart globalUnit"
    • ssh machine2 "systemctl restart globalUnit"
    • ...

So I'm 👍 about changing current behavior

@zeisss
Copy link
Contributor

zeisss commented Jun 1, 2016

FYI load/start/stop describe the desired state, not the action to perform, thus fleetctl load will move the unit from whichever state it is in to the loaded state.

dongsupark pushed a commit to dongsupark/fleet that referenced this issue Jul 28, 2016
fleetctl load and start have been working for all given units, no matter
whether each unit's target state is more activated than the current state
or not. That means, for example, fleetctl load on activated units
results in stopping the units, which could be unexpected for users.

To fix that, check that each unit really needs to be waited, by running
unitToBeChanged().

Fixes coreos#1428
dongsupark pushed a commit to dongsupark/fleet that referenced this issue Jul 28, 2016
fleetctl load and start have been working for all given units, no matter
whether each unit's target state is more activated than the current state
or not. That means, for example, fleetctl load on activated units
results in stopping the units, which could be unexpected for users.

To fix that, check that each unit really needs to be waited, by running
unitToBeChanged().

Fixes coreos#1428
dongsupark pushed a commit to dongsupark/fleet that referenced this issue Jul 28, 2016
fleetctl load and start have been working for all given units, no matter
whether each unit's target state is more activated than the current state
or not. That means, for example, fleetctl load on activated units
results in stopping the units, which could be unexpected for users.

To fix that, check that each unit really needs to be waited, by running
unitToBeChanged().

Fixes coreos#1428
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants