Re: orderlyShutdown question
Mark Miller <[email protected]>
| Newsgroups | gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Jul 2, 2010 at 9:39 AM, Mark Miller <[email protected]> wrote: > Hi Thomas, I see throughout the Runner code some support for registering > and notifying deadManSwitches when a vat dies (becomes redirected to a > DeadRunner). However, no one ever calls Runner.addDeadManSwitch(), so no > deadManSwitches are ever getting registered. It looks like the intention is > that HeadlessRunner keep all outgoing refs in its myDeadManSwitches > collection, which, as the comment says, would then need to be a weak > collection. Without doing so, not only do we get the problem you observed, > we also fail to send __reactToLostClient messages on broken outgoing links. > Or rather, on severed outgoing links. The references in question are of course not generally broken or there'd be no point. > > IIRC the redirector logic, making this change will also repair the problem > you observe without further effort. But I'm not sure. > > > > On Fri, Jul 2, 2010 at 8:28 AM, Thomas Leonard < > tal-v5nx5w6akNyLE8xUarVfuPLx9OUvmyODWmv/[email protected]> wrote: > >> On Fri, 2010-07-02 at 08:14 -0700, Kevin Reid wrote: >> > On Jul 2, 2010, at 2:37, Thomas Leonard wrote: >> > >> > > I'm having a bit of trouble with shutting down vats. Here's some test >> > > code: >> > > >> > > def makeVat := <unsafe:org.erights.e.elib.vat.makeVat> >> > > def seedVat := <elang:interp.seedVatAuthor>(<unsafe>) >> > > >> > > def test() { >> > > def [_, vat] := seedVat("5") >> > > println(`created vat $vat`) >> > > println(`shutting down vat $vat`) >> > > def result := vat<-orderlyShutdown("reason") >> > > >> > > return when (result) -> { >> > > println(`shutdown complete: $result`) >> > > test() >> > > } >> > > } >> > > >> > > test() >> > > >> > > interp.blockAtTop() >> > > >> > > >> > > The problem seems to be that once the vat is shut down, it doesn't >> > > respond to __whenMoreResolved, so the caller is never notified. >> > >> > Is that a near or far reference to the vat object? >> > >> > It's OK to use vat objects from other threads, so try having a near >> > reference instead. (And if that helps, then we can discuss the right >> > way to have that reference at hand.) >> > >> > That said, it seems to me that having a reference into a dead vat (in >> > general, whether the ref is to a vat object or just some other object >> > in that vat) ought to resolve/WMR as a broken reference. >> >> It's near, but using "." instead of "<-" doesn't make any difference >> (the result is still a promise). Here's a slightly simpler test-case: >> >> def makeVat := <unsafe:org.erights.e.elib.vat.makeVat> >> def seedVat := <elang:interp.seedVatAuthor>(<unsafe>) >> >> def [_, vat] := seedVat("5") >> println(`created vat $vat`) >> println(`shutting down vat $vat`) >> def result := vat.orderlyShutdown("reason") >> println(`shutdown result: $result`) >> >> when (result) -> { >> println(`shutdown complete: $result`) >> } >> >> interp.blockAtTop() >> >> >> $ rune shutdown.e >> created vat <Vat newSeedVat in <runs in newSeedVat>> >> shutting down vat <Vat newSeedVat in <runs in newSeedVat>> >> shutdown result: <Promise> >> [hangs] >> >> >> >> -- >> Dr Thomas Leonard >> IT Innovation Centre >> 2 Venture Road >> Southampton >> Hampshire SO16 7NP >> >> Tel: +44 0 23 8076 0834 >> Fax: +44 0 23 8076 0833 >> mailto:tal-v5nx5w6akNyLE8xUarVfuPLx9OUvmyODWmv/[email protected] >> http://www.it-innovation.soton.ac.uk >> >> _______________________________________________ >> e-lang mailing list >> [email protected] >> http://www.eros-os.org/mailman/listinfo/e-lang >> > > > > -- > Text by me above is hereby placed in the public domain > > Cheers, > --MarkM > > -- Text by me above is hereby placed in the public domain Cheers, --MarkM _______________________________________________ e-lang mailing list [email protected] http://www.eros-os.org/mailman/listinfo/e-lang