-
Notifications
You must be signed in to change notification settings - Fork 302
fleet agent does not compare contents of units in reconciler #866
Conversation
Oh yes. Might be time to tweak the UnitManager interface: |
Naming/structs are a little awkward and can probably be improved.. |
LGTM |
Well that was easy. |
@jonboulle wait, how does this work with #720? |
@bcwaldon it doesn't particularly well; I imagine it will forcibly unload/reload the units. Any ideas? |
Yeah, fails as predicted:
We obviously need to address #720 before this PR can merge. I think the most correct thing we can do here is to stop caching unit hashes in the UnitManager and pull them directly from the filesystem. |
@bcwaldon Sounds expensive. how about just doing that on startup? |
@jonboulle That would be fine. Clearly someone could change the unit file in /var/run/fleet/units while fleetd is running, but that is not exactly a supported operation in the first place. |
@jonboulle code in #987 addresses the problem |
@jonboulle good to go here |
This incorporates hashes into the decision when agent reconciler is calculating what tasks should be performed.
efecedc
to
a978c3b
Compare
@jonboulle I see you pushed a new commit. Anything notable? |
No, just rebasing. I haven't tested to my satisfaction yet. The behaviour I
|
@jonboulle We are still setting the current states to inactive on startup, if that's what you're referencing. Unless there's something else, I suggest we file that as a separate bug and move on. |
Yes pretty much - we are still loading the unit again when we shouldn't be. Will chase it up tomorrow. |
@bcwaldon updated to optimistically load/launch units |
filter.Add(u) | ||
} | ||
|
||
units, err := a.um.GetUnitStates(filter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than stealing the variable units
, can we just call this states
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we're stealing the variable states
. Naming is hard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't see that. systemdStates?
filter.Add(u) | ||
} | ||
|
||
units, err := a.um.GetUnitStates(filter) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed fetching unit states from UnitManager: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to add this additional context to the error? What will the underlying error text look like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it'll be straight from dbus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonboulle spell that out for me. Does that mean it's just going to say something like "connection error"? Or is the underlying library nice enough to say "dbus communication error: timed out waiting for response"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will either say something arbitrary taken directly from dbus, or it will be one of a few slightly nicer godbus errors like dbus: invalid method name
stunning |
ac522de
to
bfd31a2
Compare
Updated to address comments. |
@jonboulle shipit |
fleet agent does not compare contents of units in reconciler
fleetctl start
a unitfleetctl destroy
unitfleetctl start
unit with different contentsAssuming the unit gets scheduled back to the same host, easily reproducible using global units, the fleet agent will not deploy the new contents and restart the service.