private void Handle(SystemMessage.VNodeConnectionLost message)
 {
     if (_master != null && _master.Is(message.VNodeEndPoint)) // master connection failed
     {
         var msg = _state == VNodeState.PreReplica
                           ? (Message) new ReplicationMessage.ReconnectToMaster(_stateCorrelationId, _master)
                           : new SystemMessage.BecomePreReplica(_stateCorrelationId, _master);
         _mainQueue.Publish(TimerMessage.Schedule.Create(MasterReconnectionDelay, _publishEnvelope, msg));
     }
     _outputBus.Publish(message);
 }
Beispiel #2
0
        public void Handle(SystemMessage.VNodeConnectionLost message)
        {
            var node = _cluster.Members.FirstOrDefault(x => x.Is(message.VNodeEndPoint));

            if (node == null || !node.IsAlive)
            {
                return;
            }

            Log.Information("Looks like node [{nodeEndPoint}] is DEAD (TCP connection lost). Issuing a gossip to confirm.",
                            message.VNodeEndPoint);
            _bus.Publish(new GrpcMessage.SendOverGrpc(node.InternalHttpEndPoint,
                                                      new GossipMessage.GetGossip(), _timeProvider.LocalTime.Add(GossipTimeout)));
        }
Beispiel #3
0
        public void Handle(SystemMessage.VNodeConnectionLost message)
        {
            var node = _cluster.Members.FirstOrDefault(x => x.Is(message.VNodeEndPoint));

            if (node == null || !node.IsAlive)
            {
                return;
            }

            Log.Trace("Looks like node [{0}] is DEAD (TCP connection lost).", message.VNodeEndPoint);

            var oldCluster = _cluster;

            _cluster = UpdateCluster(_cluster, x => x.Is(message.VNodeEndPoint) ? x.Updated(isAlive: false) : x);
            if (_cluster.HasChangedSince(oldCluster))
            {
                LogClusterChange(oldCluster, _cluster, string.Format("TCP connection lost to [{0}]", message.VNodeEndPoint));
            }
            _bus.Publish(new GossipMessage.GossipUpdated(_cluster));
        }