[10:23] * keesj created two fresh bug reports this morning [13:27] me would like some feedback on https://bugs.launchpad.net/upstart/+bug/337665 [13:28] is is a bug or just and anoying feature [15:29] keesj: it sounds like you're inferring ordering where none exists? [16:00] Well not in the direct rules but clearly I think I defined that the services should be exclusive [16:01] there's no such thing as an exclusive service though [16:01] clearly :p [16:01] you just defined two services that used each other's events to change their own state [16:01] both can be running simultaneously [16:01] if the event queue is paused, for example [16:03] My understanding is that whenever service_b is started the service_b starting event is launched and therefore service_c will be stopped [16:04] but there is clearly a difference of interpretation between us [16:06] that will happen, yes [16:08] and 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] whuh? [16:08] let's break this down [16:08] you have: [16:08] A stop on starting service_b or starting service_c [16:09] this means that A will be stopped should B be starting [16:09] OR should C be starting [16:09] -- [16:09] B start on starting service_c [16:09] B stop on starting service_a [16:09] this means that B will be started should C be starting [16:09] and B will be stopped should A be starting [16:09] -- [16:09] C nil [16:09] this means that C is under full manual control [16:15] Keybuk: where'd you get libnih's string hashing algo? [16:16] keesj: so you do [16:16] start A [16:16] A is thus started [16:16] B will be stopped, but is already at stop, so won't go anywhere [16:16] start B [16:16] B is thus started [16:17] A will be stopped, as a result of the "starting B" event [16:17] you now have [16:17] A - stopping [16:17] B - starting [16:17] you then did [16:17] start C [16:17] there's two possible outcomes here [16:17] actually, I think there's just one [16:17] B will be started [16:17] A will be started [16:17] B is already running, so that's ok [16:18] gnargh [16:18] rewind [16:18] sorry [16:18] As and Bs confused [16:18] you then did [16:18] start C [16:18] B will be stopped [16:18] A will be started [16:18] (result of starting C) [16:18] B stopping will stop A [16:18] so A will be stopped again [16:18] I'd expect the result [16:18] A stopped [16:18] B stopped [16:19] C running [16:19] keesj: what do you see? [16:19] ah [16:19] sorry [16:19] no ing [16:19] start C [16:20] A will be started [16:20] * Keybuk gets all confused [16:20] I see that B is started before A is stopped [16:20] this is hard when you just use A and B and C as names [16:20] keesj: don't use words like "before" or "after" [16:20] Upstart has no concept [16:20] what is the final result [16:20] ie. if you sit down and leave it for five minutes [16:20] what is the resultant system state [16:21] * Keybuk retraces again [16:21] start C [16:21] starting C will start B, and stop A [16:22] B is already running anyway [16:22] A is already stopped anyway [16:22] no? [16:22] keesj: I'm sorry, but I'm completely confused as to what you're trying to demonstrate here [16:23] Keybuk: will 0.10 still need to generate events for started/starting/stopping/stopped? [16:23] sadmac2: eys [16:23] sadmac2: the libnih string hash btw is FnV [16:23] Keybuk: when do we need those events now? [16:23] ah. [16:24] keesj: just going back through this once more [16:24] # start A [16:24] now start B [16:24] starting A -> stop B, but B is not running [16:24] A is running [16:24] # start B [16:25] starting B -> stop A, so A will be stopped [16:25] you will see that first A is stoppe and only after that b is started right? [16:25] B is running [16:25] A is stopped [16:25] the after here is imporant [16:25] right [16:25] right, B starting is blocked on A stopping [16:26] if you start a again you see the reverse happen first b is stopped and then only a is started right? [16:26] right [16:26] A starting is blocked on B stopping [16:26] so we're in a state where B is running, A is stopped [16:27] you start C [16:27] starting C -> start B, but B is already running [16:27] starting C -> stop A, but A is already stopped [16:27] no? [16:28] yes that is alright [16:28] maybe you mean to do it the other way [16:28] now start a [16:28] we're in a state where A is running, B is stopped [16:28] you start C [16:28] starting C -> stop A [16:28] starting C -> start B [16:28] C will not start until A is stopped and B is started [16:29] right [16:29] but why doesn B also wait for a to be stopped, just like earlyer? [16:29] why wouldn't it? [16:29] B has nothing to do with A [16:29] B was told to stop by C [16:29] err told to start by C [16:29] C will wait for B to start [16:30] look at the chain [16:30] and A was tols to stop by B right? [16:30] told [16:30] no [16:30] A was told to stop by C [16:30] starting C -> stop A [16:30] starting C -> start B [16:30] stopping A -> ... [16:31] starting B -> stop A, but A is already being stopped [16:31] * sadmac2 contemplates inventing Event Algebra [16:31] it actually depends a bit which order it processes the events I think ;) [16:32] oh, no it doesn't [16:32] starting C -> start B [16:32] starting C -> stop A [16:32] starting B -> stop A, but A is already being stopped [16:32] Indeed , there is already some code to first stop and after that start a job if it is stop and started [16:32] stopping A -> ... [16:32] right: starting B -> stop A, but A is already being stopped.... [16:33] this is where I would expect B to wait [16:33] you want B to wait for A? [16:33] but B wasn't told to stop by A [16:33] start I mean [16:33] B has no relationship with A in this scenario [16:33] to do that [16:34] stop on (starting service_b and starting service_c) or starting service_b or starting service_c [16:34] (in A) [16:34] hm [16:34] no that won't work either [16:34] stop on starting service_b and starting service_c [16:34] is all that will do it [16:34] but that won't give you your A/B flip-flop unless C is involved [16:35] A was told to stop on starting B [16:35] no [16:35] it wasn't [16:35] starting C -> stop A [16:35] starting C -> start B [16:35] stopping A -> ... [16:35] starting B -> stop A, but A is already being stopped [16:35] A was told to stop on starting C [16:35] so stop it did [16:35] by the time B starting told it to stop, it was _already_ stopping [16:35] you used "or" [16:36] "stopping" is not enought [16:37] but what do you mean by senario? [16:37] ? [16:38] what do you mean by what do I mean? :p [16:46] I don't understand . [16:46] you say < Keybuk> B has no relationship with A in this scenario [16:48] but 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 relationship [16:50] I think you're assuming a much more complicated system than exists ;) [16:50] the bug IMHO is that A is already stopping b should wait . [16:50] A just says it will be stopped if C starts *OR* B starts [16:51] so I need to write a loop in service_b and wait until service_a is really stopped [16:51] I agree that such a feature would be desirable [16:51] but it's impossible to implement given the way 0.5 works [16:52] the problem is that stopping B just generates an event [16:52] A is already stopping, so is no longer listening for stop events [16:52] we shall have to make sure that "while not (B or C)" works [16:58] hmm [16:59] Well I will try to find shorter term solution then :p [17:30] Keybuk: fun problem for your 0.10 model: [17:31] Keybuk: service A has "when not B; on q", service B has "when not A; on q". both services exist. q happens [17:31] by exist I mean their dependencies have been found and a job struct has been created [17:32] no problem there ;) [17:32] Keybuk: which one starts would depend on the order of processing. [17:32] if you start A, it precludes B. if you start B it precludes A [17:42] Keybuk: care to elaborate?