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

Agent.Initialize causes major race conditions on startup #669

Closed
bcwaldon opened this issue Jul 14, 2014 · 5 comments
Closed

Agent.Initialize causes major race conditions on startup #669

bcwaldon opened this issue Jul 14, 2014 · 5 comments
Milestone

Comments

@bcwaldon
Copy link
Contributor

When fleet starts, it attempts to unload any units locally that it knows it started in a past life, but are now scheduled elsewhere [0]. As soon as fleet kicks off the unload routine for that unit, it subscribes to events. If the unit that fleet just started unloading is then scheduled back to that machine, fleet will start it [1]. These two routines are now racing to finish first. If the unload finishes first, everything is ok. If the unload doesn't finish before the unit is scheduled, you'll get into this situation:

$ fleetctl list-units
UNIT                STATE       LOAD        ACTIVE      SUB     DESC    MACHINE
foo.service         launched    not-found   inactive    failed  -       af6ffd86.../192.0.2.32

The unit clearly has state published for it, but it's "not-found". This is because the unload routine finished after the unit was started, and destroyed the unit file on disk.

[0]

go func() {

[1]
go func() {

@jonboulle
Copy link
Contributor

What do you propose here; queuing actions related to a specific unit?

@bcwaldon
Copy link
Contributor Author

@jonboulle at a minimum, we should reconsider the use of "replace" when calling dbus methods.

@bcwaldon
Copy link
Contributor Author

Agent.initialize no longer exists!

@jonboulle
Copy link
Contributor

Not to burst your bubble pal, but Reconcile is basically just Initialize by another name, so I'd say this ticket still applies. But if you want to consider it addressed by #646 that is probably sufficient.

@bcwaldon
Copy link
Contributor Author

That's what I was implying. Reconcile is different than Initialize, however, as it does not run while events are also mutating state. #646 covers the whole issue at this point

@bcwaldon bcwaldon added this to the v0.6.0 milestone Jul 27, 2014
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

2 participants