Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote watching is repeated #1090

Closed
rogeralsing opened this issue Jun 23, 2015 · 8 comments
Closed

Remote watching is repeated #1090

rogeralsing opened this issue Jun 23, 2015 · 8 comments

Comments

@rogeralsing
Copy link
Contributor

If like 243 is uncommented in the RemoteSystemDaemon:

           //TODO: figure out why current transport is not set when this message is sent
          parent.Tell(new Watch(parent, this),this);

The system that trigger the watch will repeatedly send Re-watching to the remote system.
remotewatch

I guess this is not expected(?)
What and why is the reason of a re-watch?

cc @Aaronontheweb

@Aaronontheweb
Copy link
Member

Yep, that's a mystery. Might be a bug in the ReliableDeliveryActor responsible for guaranteed delivery of system messages inside Akka.Remote

@rogeralsing
Copy link
Contributor Author

Or is this intended??, I found this peice of code:

        private void ReceiveHeartbeatRsp(int uid)  //<--- on heartbeat
        {
            var from = Sender.Path.Address;

            if (_failureDetector.IsMonitoring(from))
            {
                _log.Debug("Received heartbeat rsp from [{0}]", from);
            }
            else
            {
                _log.Debug("Received first heartbeat rsp from [{0}]", from);
            }

            if (_watchingNodes.Contains(from) && !_unreachable.Contains(from))  //<--- checks if we are watching this node
            {
                if (!_addressUids.ContainsKey(from) || _addressUids.ContainsKey(from))
                    ReWatch(from);                                                           //<-- sends rewatch
                _addressUids[from] = uid;
                _failureDetector.Heartbeat(from);
            }
        }

See inline comments

@Aaronontheweb
Copy link
Member

Oh yeah, definitely looks intended. Which class is this from? I'd be interested to see if it's still done this way on the JVM.

@rogeralsing
Copy link
Contributor Author

RemoteWatcher.cs

@rogeralsing
Copy link
Contributor Author

In any case, the above code explans why the rewatch appears in sync with the heartbeats.
But it seems expensive to do this for each beat imo.

@Aaronontheweb
Copy link
Member

@rogeralsing looks like they still do this on the JVM too https://github.com/akka/akka/blob/master/akka-remote/src/main/scala/akka/remote/RemoteWatcher.scala#L150

so is there something we need to uncomment in order to enable this?

As far as the overhead goes, these messages are pretty small - but I can see why they added them from a semantic standpoint (re-affirm upon heartbeat that the remotely watched actors still exist.) Would love to hear what the reasoning was for introducing this though.

@rogeralsing
Copy link
Contributor Author

I sent a new mini PR for this #1091

@Aaronontheweb
Copy link
Member

Closed by #1099

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants