A Gated node can't be connected to from this process for TimeOfRelease, but we may accept an inbound connection from it if the remote node recovers on its own.
Inheritance: EndpointPolicy
Ejemplo n.º 1
0
 /// <summary>
 /// Marking an endpoint as failed means that we will not try to connect to the remote system within
 /// the gated period but it is ok for the remote system to try to connect with us (inbound-only.)
 /// </summary>
 /// <param name="endpoint">The endpoint actor.</param>
 /// <param name="timeOfRelease">The time to release the failure policy.</param>
 public void MarkAsFailed(IActorRef endpoint, Deadline timeOfRelease)
 {
     if (IsWritable(endpoint))
     {
         var address = _writableToAddress[endpoint];
         if (_addressToWritable.TryGetValue(address, out var policy))
         {
             if (policy is EndpointManager.Quarantined)
             {
                 // don't overwrite Quarantined with Gated
             }
             else if (policy is EndpointManager.Pass)
             {
                 _addressToWritable[address] = new EndpointManager.Gated(timeOfRelease);
                 _writableToAddress.Remove(endpoint);
             }
             else if (policy is EndpointManager.Gated)
             {
                 // already gated
             }
         }
         else
         {
             _addressToWritable[address] = new EndpointManager.Gated(timeOfRelease);
             _writableToAddress.Remove(endpoint);
         }
     }
     else if (IsReadOnly(endpoint))
     {
         _addressToReadonly.Remove(_readonlyToAddress[endpoint]);
         _readonlyToAddress.Remove(endpoint);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Marking an endpoint as failed means that we will not try to connect to the remote system within
 /// the gated period but it is ok for the remote system to try to connect with us (inbound-only.)
 /// </summary>
 public void MarkAsFailed(IActorRef endpoint, Deadline timeOfRelease)
 {
     if (IsWritable(endpoint))
     {
         _addressToWritable[_writableToAddress[endpoint]] = new EndpointManager.Gated(timeOfRelease);
         _writableToAddress.Remove(endpoint);
     }
     else if (IsReadOnly(endpoint))
     {
         _addressToReadonly.Remove(_readonlyToAddress[endpoint]);
         _readonlyToAddress.Remove(endpoint);
     }
 }
Ejemplo n.º 3
0
 public void RegisterWritableEndpointRefuseUid(Address remoteAddress, int refuseUid)
 {
     EndpointManager.EndpointPolicy existing;
     if (_addressToWritable.TryGetValue(remoteAddress, out existing))
     {
         var pass = existing as EndpointManager.Pass;
         if (pass != null)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.Pass(pass.Endpoint, pass.Uid, refuseUid);
         } else if (existing is EndpointManager.Gated)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.Gated(((EndpointManager.Gated)existing).TimeOfRelease, refuseUid);
         }
         else if (existing is EndpointManager.WasGated)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.WasGated(refuseUid);
         }
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="remoteAddress">TBD</param>
 /// <param name="refuseUid">TBD</param>
 public void RegisterWritableEndpointRefuseUid(Address remoteAddress, int refuseUid)
 {
     if (_addressToWritable.TryGetValue(remoteAddress, out var existing))
     {
         var pass = existing as EndpointManager.Pass;
         if (pass != null)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.Pass(pass.Endpoint, pass.Uid, refuseUid);
         }
         else if (existing is EndpointManager.Gated)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.Gated(((EndpointManager.Gated)existing).TimeOfRelease, refuseUid);
         }
         else if (existing is EndpointManager.WasGated)
         {
             _addressToWritable[remoteAddress] = new EndpointManager.WasGated(refuseUid);
         }
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Marking an endpoint as failed means that we will not try to connect to the remote system within
 /// the gated period but it is ok for the remote system to try to connect with us (inbound-only.)
 /// </summary>
 public void MarkAsFailed(IActorRef endpoint, Deadline timeOfRelease)
 {
     if (IsWritable(endpoint))
     {
         var address = _writableToAddress[endpoint];
         EndpointManager.EndpointPolicy policy;
         if (_addressToWritable.TryGetValue(address, out policy))
         {
             if (policy is EndpointManager.Quarantined)
             {
             } // don't overwrite Quarantined with Gated
             if (policy is EndpointManager.Pass)
             {
                 _addressToWritable[address] = new EndpointManager.Gated(timeOfRelease,
                                                                         policy.AsInstanceOf <EndpointManager.Pass>().RefuseUid);
                 _writableToAddress.Remove(endpoint);
             }
             else if (policy is EndpointManager.WasGated)
             {
                 _addressToWritable[address] = new EndpointManager.Gated(timeOfRelease,
                                                                         policy.AsInstanceOf <EndpointManager.WasGated>().RefuseUid);
                 _writableToAddress.Remove(endpoint);
             }
             else if (policy is EndpointManager.Gated)
             {
             } // already gated
         }
         else
         {
             _addressToWritable[address] = new EndpointManager.Gated(timeOfRelease, null);
             _writableToAddress.Remove(endpoint);
         }
     }
     else if (IsReadOnly(endpoint))
     {
         _addressToReadonly.Remove(_readonlyToAddress[endpoint]);
         _readonlyToAddress.Remove(endpoint);
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Marking an endpoint as failed means that we will not try to connect to the remote system within
 /// the gated period but it is ok for the remote system to try to connect with us (inbound-only.)
 /// </summary>
 public void MarkAsFailed(IActorRef endpoint, Deadline timeOfRelease)
 {
     if (IsWritable(endpoint))
     {
         _addressToWritable[_writableToAddress[endpoint]] = new EndpointManager.Gated(timeOfRelease);
         _writableToAddress.Remove(endpoint);
     }
     else if (IsReadOnly(endpoint))
     {
         _addressToReadonly.Remove(_readonlyToAddress[endpoint]);
         _readonlyToAddress.Remove(endpoint);
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Marking an endpoint as failed means that we will not try to connect to the remote system within
 /// the gated period but it is ok for the remote system to try to connect with us (inbound-only.)
 /// </summary>
 public void MarkAsFailed(IActorRef endpoint, Deadline timeOfRelease)
 {
     if (IsWritable(endpoint))
     {
         var address = _writableToAddress[endpoint];
         EndpointManager.EndpointPolicy policy;
         if (_addressToWritable.TryGetValue(address, out policy))
         {
             if (policy is EndpointManager.Quarantined)
             {
             } // don't overwrite Quarantined with Gated
             if (policy is EndpointManager.Pass)
             {
                 _addressToWritable[address] = new EndpointManager.Gated(timeOfRelease,
                     policy.AsInstanceOf<EndpointManager.Pass>().RefuseUid);
                 _writableToAddress.Remove(endpoint);
             }
             else if (policy is EndpointManager.WasGated)
             {
                 _addressToWritable[address] = new EndpointManager.Gated(timeOfRelease,
                     policy.AsInstanceOf<EndpointManager.WasGated>().RefuseUid);
                 _writableToAddress.Remove(endpoint);
             }
             else if (policy is EndpointManager.Gated)
             {
             } // already gated
         }
         else
         {
             _addressToWritable[address] = new EndpointManager.Gated(timeOfRelease, null);
             _writableToAddress.Remove(endpoint);
         }
     }
     else if (IsReadOnly(endpoint))
     {
         _addressToReadonly.Remove(_readonlyToAddress[endpoint]);
         _readonlyToAddress.Remove(endpoint);
     }
 }