SturdyRefs and boot-comm (hangs)
Thomas Leonard <[email protected]>
| Newsgroups | gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
This program prints
<Promise>
and then hangs, consuming 100% CPU:
def seedVatAuthor := <elang:interp.seedVatAuthor>
def seedVat := seedVatAuthor(<unsafe>)
def sr := seedVat("introducer.onTheAir(); makeSturdyRef.temp(42)")[0]
println(sr)
when (sr) -> {
println(`resolved: $sr`)
interp.continueAtTop()
}
interp.blockAtTop()
SturdyRefs are not PassByProxy, but BootRefHandler doesn't know how to
send them, so it pretends they are:
//XXX For now, if it isn't passable over boot comm, treat it as
// if it was PassByProxy.
// T.fail("Not passable over boot-comm: " +
// ClassDesc.simpleSig(arg.getClass()));
// return null; //make compiler happy
BootRefHandler handler = new BootRefHandler(src, arg);
return handler.myResolver.getProxy();
But in the constructor, only PassByProxy objects get an identity:
Object optIdentity = null;
if (Ref.isPassByProxy(target)) {
optIdentity = new BootRefIdentity(target);
}
myResolver = new EProxyResolver(this, optIdentity);
This causes a <Promise> to be sent. The receiver calls
<Promise>.__whenMoreResolved, but when the SturdyRef tries to send
itself back in the reply, it gets turned into a promise again, so the
receiver calls __whenMoreResolved again, forever.
--
Dr Thomas Leonard
GPG: 9242 9807 C985 3C07 44A6 8B9A AE07 8280 59A5 3CC1
GPG: DA98 25AE CAD0 8975 7CDA BD8E 0713 3F96 CA74 D8BA