Closed telephon closed 7 years ago
Yes. Technically I think this is an SC issue, not a Utopia one. It didn't happen IIRC before boost::asio
My guess is that it happens here:
gUDPport->Socket().send_to( buffer(bufptr, msglen), address );
Possibly there should be a local catch function around that (or in the primitive maybe better) which would then return an SC error. Then I think it would be possible to use a try in Utopia or elsewhere to suppress this common case.
Or get more reliable collaborators! ;-)
ha :) do you know what situation causes it? and also i wonder: udp is connectionless, so how can it know anything about a "host"?
Hi s & j, we do network music with Utopia this semester again, got a rather nice setup together, up to 16 people :-) we do see this one a lot unfortunately ...
BTW I just got the clientID from server & make allocators issue sorted nicely, so now independent allocation finally works well. will submit PR (to SC3) when well-tested.
bests a
what is your quick workaround when it happens? it is quite annoying
thanks for the work on server, it's much needed.
ha :) do you know what situation causes it? and also i wonder: udp is connectionless, so how can it know anything about a "host"?
Seemingly might have to do with ARP requests: https://forum.pfsense.org/index.php?topic=122234.0
BTW I just got the clientID from server & make allocators issue sorted nicely, so now independent allocation finally works well. will submit PR (to SC3) when well-tested.
Sorry what was the issue? I used this on a couple of projects after it was added initially, and it always worked fine.
I can't figure out how to get a reproducer.
Do either of you have one?
It always involves at least two computers. Today it happened when one of the students closed down his computer, which before had been "hailed into" Utopia.
I'll see if I can get it going tomorrow if I get a moment. I have a couple of machines in my office so can try. I've guessed it had something to do with sleeping or machines otherwise falling off the network.
Utopia will trigger it because it keeps trying to Hail. We could make it give up after a certain period of non-response, but it seems the wrong solution.
But the fact that we're getting 'caught exception in primitive' suggests to me that something is not being handled correctly. That's just a catch all in doPrimitive to make sure the lang doesn't fall over when something unexpected happens.
yes, that seems wrong. I don't see why it should be wrong to try and send to an ip that seems to be down.
yes
Well I suspect it dutifully notifies you and expects you to handle it in an appropriate way if you don't care. I can put in a try catch in the right place, but until I can reliably reproduce, I won't know if it's helping.
if you have an idea how to catch it, we can try and reproduce it next week (tuesday).
Okay, I just spent an hour trying to reproduce it, and failed (though I did notice that there seems to be a mistake with Hail and how it tracks online status). I can get the network unreachable though, which I suspect is thrown from the same point.
So looking a little closer, in doPrimitive we have blocks like this:
} catch (std::exception& ex) {
post("caught exception in primitive %s:%s\n", slotRawSymbol(&slotRawClass(&meth->ownerclass)->name)->name, slotRawSymbol(&meth->name)->name);
error(ex.what());
err = errException;
}
IIUC this means we do get the SC error, which we should be able to suppress with an SC try, but we can't suppress the warning from error(ex.what());
.
So we could for instance wrap netAddrSend(slotRawObject(netAddrSlot), packet.size(), (char*)packet.buf);
in a try, and catch certain errors, but I'd need to look a little more closely at this to see what's the correct way. I think it would be to define new SC error types, e.g. errNetworkUnreachable, errHostIsDown
The following seems to confirm my suspicion of where this is happening.
NetAddr("147.108.63.7", 51720).sendMsg(\foo)
try { NetAddr("147.108.63.7", 51720).sendMsg(\foo) } { \caught.postln }
The former throws the SC error, the latter only the warning. Since network errors should not be suppressed in normal usage, I think the only way to deal with this is new SC error types. We'd need one for host is down and one from network unreachable. Anything else?
Hmm. Another, possibly better solution would be to have error.what()
stashed somewhere accessible rather than posted, and then recalled in prPrimitiveErrorString
. It's more general.
I'm working on this...
Okay got something. Will submit a PR tomorrow.
https://github.com/supercollider/supercollider/pull/2876
Will close this when merged, but test in the meantime if you can.
This can be closed now that SC/2876 is merged!
Thanks @brianlheim!
We still get this all the time: