/srv/irclogs.ubuntu.com/2009/03/04/#upstart.txt

* keesj created two fresh bug reports this morning 10:23
keesjme would like some feedback on https://bugs.launchpad.net/upstart/+bug/33766513:27
keesjis is a bug or just and anoying feature13:28
Keybukkeesj: it sounds like you're inferring ordering where none exists?15:29
keesjWell not in the direct rules but clearly I think I defined that the services should be exclusive16:00
Keybukthere's no such thing as an exclusive service though16:01
keesjclearly :p16:01
Keybukyou just defined two services that used each other's events to change their own state16:01
Keybukboth can be running simultaneously16:01
Keybukif the event queue is paused, for example16:01
keesjMy understanding is that whenever service_b is started the service_b starting event is launched and therefore service_c will be stopped 16:03
keesjbut there is clearly a difference of interpretation between us16:04
Keybukthat will happen, yes16:06
keesjand why isn't service_b waiting for service_a to be stopped (or actlaly why doesn't service_a block the starting of service_b) ?16:08
Keybukwhuh?16:08
Keybuklet's break this down16:08
Keybukyou have:16:08
KeybukA stop on starting service_b or starting service_c16:08
Keybukthis means that A will be stopped should B be starting16:09
KeybukOR should C be starting16:09
Keybuk--16:09
KeybukB start on starting service_c16:09
KeybukB stop on starting service_a16:09
Keybukthis means that B will be started should C be starting16:09
Keybukand B will be stopped should A be starting16:09
Keybuk--16:09
KeybukC nil16:09
Keybukthis means that C is under full manual control16:09
sadmac2Keybuk: where'd you get libnih's string hashing algo?16:15
Keybukkeesj: so you do16:16
Keybukstart A16:16
KeybukA is thus started16:16
KeybukB will be stopped, but is already at stop, so won't go anywhere16:16
Keybukstart B16:16
KeybukB is thus started16:16
KeybukA will be stopped, as a result of the "starting B" event16:17
Keybukyou now have16:17
KeybukA - stopping16:17
KeybukB - starting16:17
Keybukyou then did16:17
Keybukstart C16:17
Keybukthere's two possible outcomes here16:17
Keybukactually, I think there's just one16:17
KeybukB will be started16:17
KeybukA will be started16:17
KeybukB is already running, so that's ok16:17
Keybukgnargh16:18
Keybukrewind16:18
Keybuksorry16:18
KeybukAs and Bs confused16:18
Keybukyou then did16:18
Keybukstart C16:18
KeybukB will be stopped16:18
KeybukA will be started16:18
Keybuk(result of starting C)16:18
KeybukB stopping will stop A16:18
Keybukso A will be stopped again16:18
KeybukI'd expect the result16:18
KeybukA stopped16:18
KeybukB stopped16:18
KeybukC running16:19
Keybukkeesj: what do you see?16:19
Keybukah16:19
Keybuksorry16:19
Keybukno ing16:19
Keybukstart C16:19
KeybukA will be started16:20
* Keybuk gets all confused16:20
keesjI see that B is started before A is stopped16:20
Keybukthis is hard when you just use A and B and C as names16:20
Keybukkeesj: don't use words like "before" or "after"16:20
KeybukUpstart has no concept16:20
Keybukwhat is the final result16:20
Keybukie. if you sit down and leave it for five minutes16:20
Keybukwhat is the resultant system state16:20
* Keybuk retraces again16:21
Keybukstart C16:21
Keybukstarting C will start B, and stop A16:21
KeybukB is already running anyway16:22
KeybukA is already stopped anyway16:22
Keybukno?16:22
Keybukkeesj: I'm sorry, but I'm completely confused as to what you're trying to demonstrate here16:22
sadmac2Keybuk: will 0.10 still need to generate events for started/starting/stopping/stopped?16:23
Keybuksadmac2: eys16:23
Keybuksadmac2: the libnih string hash btw is FnV16:23
sadmac2Keybuk: when do we need those events now?16:23
sadmac2ah.16:23
Keybukkeesj: just going back through this once more16:24
Keybuk# start A16:24
keesjnow start B16:24
Keybukstarting A -> stop B, but B is not running16:24
KeybukA is running16:24
Keybuk# start B16:24
Keybukstarting B -> stop A, so A will be stopped16:25
keesjyou will see that first A is stoppe and only after that b is started right?16:25
KeybukB is running16:25
KeybukA is stopped16:25
keesjthe after here is imporant16:25
Keybukright16:25
Keybukright, B starting is blocked on A stopping16:25
keesjif you start a again you see the reverse happen first b is stopped and then only a is started right?16:26
Keybukright16:26
KeybukA starting is blocked on B stopping16:26
Keybukso we're in a state where B is running, A is stopped16:26
Keybukyou start C16:27
Keybukstarting C -> start B, but B is already running16:27
Keybukstarting C -> stop A, but A is already stopped16:27
Keybukno?16:27
keesjyes that is alright16:28
Keybukmaybe you mean to do it the other way16:28
keesjnow start a16:28
Keybukwe're in a state where A is running, B is stopped16:28
Keybukyou start C16:28
Keybukstarting C -> stop A16:28
Keybukstarting C -> start B16:28
KeybukC will not start until A is stopped and B is started16:28
keesjright16:29
keesjbut why doesn B also wait for a to be stopped, just like earlyer?16:29
Keybukwhy wouldn't it?16:29
KeybukB has nothing to do with A16:29
KeybukB was told to stop by C16:29
Keybukerr told to start by C16:29
KeybukC will wait for B to start16:29
Keybuklook at the chain16:30
keesjand A was tols to stop by B right?16:30
keesjtold16:30
Keybukno16:30
KeybukA was told to stop by C16:30
Keybukstarting C -> stop A16:30
Keybukstarting C -> start B16:30
Keybukstopping A -> ...16:30
Keybukstarting B -> stop A, but A is already being stopped16:31
* sadmac2 contemplates inventing Event Algebra16:31
Keybukit actually depends a bit which order it processes the events I think ;)16:31
Keybukoh, no it doesn't16:32
Keybukstarting C -> start B16:32
Keybukstarting C -> stop A16:32
Keybukstarting B -> stop A, but A is already being stopped16:32
keesjIndeed , there is already some code to first stop and after that start a job if it is stop and started16:32
Keybukstopping A -> ...16:32
keesjright: starting B -> stop A, but A is already being stopped....16:32
keesjthis is where I would expect B to wait16:33
Keybukyou want B to wait for A?16:33
Keybukbut B wasn't told to stop by A16:33
Keybukstart I mean16:33
KeybukB has no relationship with A in this scenario16:33
Keybukto do that16:33
Keybukstop on (starting service_b and starting service_c) or starting service_b or starting service_c16:34
Keybuk(in A)16:34
Keybukhm16:34
Keybukno that won't work either16:34
Keybukstop on starting service_b and starting service_c16:34
Keybukis all that will do it16:34
Keybukbut that won't give you your A/B flip-flop unless C is involved16:34
keesjA was told to stop on starting B 16:35
Keybukno16:35
Keybukit wasn't16:35
Keybuk starting C -> stop A16:35
Keybuk starting C -> start B16:35
Keybuk stopping A -> ...16:35
Keybuk starting B -> stop A, but A is already being stopped16:35
KeybukA was told to stop on starting C16:35
Keybukso stop it did16:35
Keybukby the time B starting told it to stop, it was _already_ stopping16:35
Keybukyou used "or"16:35
keesj"stopping" is not enought 16:36
keesjbut what do you mean by senario?16:37
Keybuk?16:37
Keybukwhat do you mean by what do I mean? :p16:38
keesjI don't understand . 16:46
keesjyou say < Keybuk> B has no relationship with A in this scenario16:46
keesjbut I am not aware of such a concept. In my understanding is that there is a state tree with events. B and A always have a relationship16:48
KeybukI think you're assuming a much more complicated system than exists ;)16:50
keesjthe bug IMHO is that A is already stopping b should wait .16:50
KeybukA just says it will be stopped if C starts *OR* B starts16:50
keesjso I need to write a loop in service_b and wait until service_a is really stopped 16:51
KeybukI agree that such a feature would be desirable16:51
Keybukbut it's impossible to implement given the way 0.5 works16:51
Keybukthe problem is that stopping B just generates an event16:52
KeybukA is already stopping, so is no longer listening for stop events16:52
Keybukwe shall have to make sure that "while not (B or C)" works16:52
keesjhmm 16:58
keesjWell I will try to find shorter term solution then :p16:59
sadmac2Keybuk: fun problem for your 0.10 model:17:30
sadmac2Keybuk: service A has "when not B; on q", service B has "when not A; on q". both services exist. q happens17:31
sadmac2by exist I mean their dependencies have been found and a job struct has been created17:31
Keybukno problem there ;)17:32
sadmac2Keybuk: which one starts would depend on the order of processing.17:32
sadmac2if you start A, it precludes B. if you start B it precludes A17:32
sadmac2Keybuk: care to elaborate?17:42

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!