5
votes

While writing Scala RemoteActor code, I noticed some pitfalls:

  • RemoteActor.classLoader = getClass().getClassLoader() has to be set in order to avoid "java.lang.ClassNotFoundException"
  • link doesn't always work due to "a race condition for which a NetKernel (the facility responsible for forwarding messages remotely) that backs a remote actor can close before the remote actor's proxy (more specifically, proxy delegate) has had a chance to send a message remotely indicating the local exit." (Stephan Tu)
  • RemoteActor.select doesn't always return the same delegate (RemoteActor.select - result deterministic?)
  • Sending a delegate over the network prevents the application to quit normally (RemoteActor unregister actor)
  • Remote Actors won't terminate if RemoteActor.alive() and RemoteActor.register() are used outside act. (See the answer of Magnus)

Are there any other pitfalls a programmer should be aware of?

1
I'm currently up against the "RemoteActor.classLoader = ..." pitfall, but even though I need this line somewhere, I can't work out where! Can anyone point to an explanation of this?Scott Morrison

1 Answers

2
votes

Here's another; you need to put your RemoteActor.alive() and RemoteActor.register() calls inside your act method when you define your actor or the actor won't terminate when you call exit(); see How do I kill a RemoteActor?