Possible RemoteServer bug needs analysis
There is already a bug here:
current register functions are like this:
if (_isRunning && !registry.contains(id)) registry.put(id, typedActor)
The contains is an alias for containsValue, not containsKey, so it is the same as:
if (_isRunning && !registry.containsValue(id)) registry.put(id, typedActor)
since we never put the id of actors as the values, this is effectivelly the same as:
if (_isRunning) registry.put(id, typedActor)
If I change it to this:
if (_isRunning && !registry.containsKey(id)) registry.put(id, typedActor)
which is what the putIfAbsent would do (but atomically) then tests* fail because some actors are never deregistered.*
I will leave it as contains(id), because this problem is orthogonal to my branch, but note there is a problem here.
current register functions are like this:
if (_isRunning && !registry.contains(id)) registry.put(id, typedActor)
The contains is an alias for containsValue, not containsKey, so it is the same as:
if (_isRunning && !registry.containsValue(id)) registry.put(id, typedActor)
since we never put the id of actors as the values, this is effectivelly the same as:
if (_isRunning) registry.put(id, typedActor)
If I change it to this:
if (_isRunning && !registry.containsKey(id)) registry.put(id, typedActor)
which is what the putIfAbsent would do (but atomically) then tests* fail because some actors are never deregistered.*
I will leave it as contains(id), because this problem is orthogonal to my branch, but note there is a problem here.
Leave a comment
Is it not better to just overwrite the previous value? E.g. like we have now. Think so. Closing ticket.