orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Orleans 集群的问题

Open 286882181qqcom opened this issue 10 years ago • 34 comments

服务集群时: 如果 其中一个正常退出时,一切ok 服务集群时:只要其中一个服务(不正常)退出时,其它服务 会报错, 导致 客户端 调用阻塞 会延迟很久,才能正常调用。这是为什么呢?

我看了官方文档,说是 每个服务之间会相互监控,当一个 其中一服务(不正)常退出时,其它服务会报这个服务连接失败的错误信息并尝试连接这个服务,是不是这个原因导致(客户端 调用阻塞 会延迟很久)?

以下是集群(采用sql server 作为服务协调)的配置 图如下:

服务端:

<OrleansConfiguration xmlns="urn:orleans">
  <Globals>
    <SystemStore SystemStoreType ="SqlServer"
                 DeploymentId="OrleansTest"
                 DataConnectionString="Data Source=.;Initial Catalog=OrleansTest;Integrated Security=True;Pooling=False;Max Pool Size=200;Asynchronous Processing=True;MultipleActiveResultSets=True;user id=sa;password=123456" AdoInvariant="System.Data.SqlClient" />
  </Globals>
  <Defaults>
    <Tracing DefaultTraceLevel="Info" TraceToConsole="true" TraceToFile="{0}-{1}.log" PropagateActivityId="false" BulkMessageLimit="1000">
      <TraceLevelOverride LogPrefix="Application" TraceLevel="Info" />
    </Tracing>
  </Defaults>
  <Override Node="delault1">
    <Networking Address="localhost" Port="22221" />
    <ProxyingGateway Address="localhost" Port="40001" />
  </Override>
  <Override Node="delault2">
    <Networking Address="localhost" Port="22222" />
    <ProxyingGateway Address="localhost" Port="40002" />
  </Override>
  <Override Node="delault3">
    <Networking Address="localhost" Port="22223" />
    <ProxyingGateway Address="localhost" Port="40003" />
  </Override>
</OrleansConfiguration>

客户端

<?xml version="1.0" encoding="utf-8" ?>
<ClientConfiguration xmlns="urn:orleans">
  <SystemStore SystemStoreType ="SqlServer"
                DeploymentId="OrleansTest"
                DataConnectionString="Data Source=.;Initial Catalog=OrleansTest;Integrated Security=True;Pooling=False;Max Pool Size=200;Asynchronous Processing=True;MultipleActiveResultSets=True;user id=sa;password=123456" AdoInvariant="System.Data.SqlClient" />
  <Tracing DefaultTraceLevel="Info" TraceToConsole="true" TraceToFile="{0}-{1}.log" WriteMessagingTraces="false" BulkMessageLimit="1000">
    <TraceLevelOverride LogPrefix="Runtime" TraceLevel="Info" />
    <TraceLevelOverride LogPrefix="Application" TraceLevel="Info" />
    <TraceLevelOverride LogPrefix="AssemblyLoader" TraceLevel="Warning" />
  </Tracing>
  <Messaging ResponseTimeout="30s" ClientSenderBuckets="8192" MaxResendCount="0" />
</ClientConfiguration>

286882181qqcom avatar Oct 30 '16 07:10 286882181qqcom

@286882181qqcom if a node exits abnormally, the client will throw an exception so it can retry and connect to a silo which is alive. It will not delay for a long time. Do I understand the question correctly?

ReubenBond avatar Oct 30 '16 09:10 ReubenBond

不是客户 抛出异常,而是其它的所有服务节点异常,导致 客户端 无法调用。 也就是说一个服务节点异常退出,会导致其它所有服务节点抛出异常, 这时候其它服务节点都 在抛出异常 线程阻塞,就没有能力处理客户端的请求,所以客户端调用延迟很长一段时间。 这是不正常的。是不是我那里没有设置对呢?,还是BUG?

286882181qqcom avatar Oct 30 '16 09:10 286882181qqcom

@ReubenBond

286882181qqcom avatar Oct 30 '16 09:10 286882181qqcom

Are you saying that if you kill a silo, the cluster never recovers?

ReubenBond avatar Oct 30 '16 10:10 ReubenBond

@ReubenBond he's talking about, when killing a silo(one of N), the GrainClient will block for a while.

egmkang avatar Oct 31 '16 05:10 egmkang

@egmkang that's what I thought - in my first response I say that it should not block for a long time. I wonder how long is "a while" here.

Of course, hosting 3 silos on a single machine (as in the example) won't give you fault tolerance anyhow.

ReubenBond avatar Oct 31 '16 06:10 ReubenBond

He is talking about : I think I translated it correctly: If one silo exits abnormally, and other silos will be trying to connect to it, busy throwing exceptions which would cause blocking in its process, he is suspecting that is causing long blocking time in GrainClient. Since all other silos are busy reporting the dead silo and throwing exceptions, they will not have capability to response GrainClient's requests

@286882181qqcom I think it's not all silos will be trying to connect to the dead silo. It is one or two silo discovered the dead silo and report its status to Membership. And the reporting time shouldn't be too long.

xiazen avatar Oct 31 '16 23:10 xiazen

@xiazen 你的翻是对的。但这个问题 会导致客户端 阻塞 30秒以上。这情况对于实时交易的系统来说是不允许。有没有办法解决呢?或者说你们是怎么做的呢?有没有代码可以参考呢?

286882181qqcom avatar Nov 04 '16 06:11 286882181qqcom

The default timeout on client side is 30 sec based on your config file. That could be one of the reasons. The client is trying to connect to the dead silo, the connection time out after 30 sec. Does your client retry after connection timeout?

And as @ReubenBond mentioned,

hosting 3 silos on a single machine (as in the example) maybe won't give you fault tolerance anyhow.

A little share of your code or logs will help.

xiazen avatar Nov 04 '16 06:11 xiazen

这个问题我们也存在,同一个用户同时发起N多个请求很容易出现30s超时,但事实上数据都是成功的

DeepSkyJees avatar Nov 08 '16 07:11 DeepSkyJees

First of all, this is not normal for Orleans. Not by design lol ;) so I suspect there's a problem with your Orleans application set up.

Second of all, share us some of the logs can help, because many causes can contribute to this problem.

For code sample, you can look at our sample folder

xiazen avatar Nov 08 '16 18:11 xiazen

paste us some logs where you think it is suspicious :)

xiazen avatar Nov 08 '16 18:11 xiazen

@xiazen 服务节点 代码如下: ------------------------------------接口----------------------

using System.Threading.Tasks;
using Orleans;
namespace Sample.GrainInterfaces
{
    /// <summary>
    /// Grain interface IGrain1
    /// </summary>
    public interface IGrain1 : IGrainWithIntegerKey
    {
        Task<bool> Exist(string n);
    }
}

-------------------------------------实现者-----------------------

using System;
using System.Threading.Tasks;
using Orleans;
using Sample.GrainInterfaces;
namespace Sample.GrainsClass
{
    /// <summary>
    /// Grain implementation class Grain1.
    /// </summary>
    public class Grain1 : Grain, IGrain1
    {
        public Task<bool> Exist(string n)
        {
            Console.WriteLine("我处理了一个请求。");
            return Task.FromResult(n == "130");
        }
    }
}

---------------------------------服务-------------------------

using System;
using System.Threading.Tasks;

using Orleans;
using Orleans.Runtime.Configuration;

namespace SiloHost1
{
    /// <summary>
    /// Orleans test silo host
    /// </summary>
    public class Program
    {
        static void Main(string[] args)
        {
            // The Orleans silo environment is initialized in its own app domain in order to more
            // closely emulate the distributed situation, when the client and the server cannot
            // pass data via shared memory.
            AppDomain hostDomain = AppDomain.CreateDomain("OrleansHost", null, new AppDomainSetup
            {
                AppDomainInitializer = InitSilo,
                AppDomainInitializerArguments = args,
            });

          //  var config = ClientConfiguration.LocalhostSilo();
         //   GrainClient.Initialize(config);

            // TODO: once the previous call returns, the silo is up and running.
            //       This is the place your custom logic, for example calling client logic
            //       or initializing an HTTP front end for accepting incoming requests.

            Console.WriteLine("Orleans Silo is running.\nPress Enter to terminate...");
            Console.ReadLine();

            hostDomain.DoCallBack(ShutdownSilo);
        }

        static void InitSilo(string[] args)
        {
            hostWrapper = new OrleansHostWrapper(args);

            if (!hostWrapper.Run())
            {
                Console.Error.WriteLine("Failed to initialize Orleans silo");
            }
        }

        static void ShutdownSilo()
        {
            if (hostWrapper != null)
            {
                hostWrapper.Dispose();
                GC.SuppressFinalize(hostWrapper);
            }
        }

        private static OrleansHostWrapper hostWrapper;//这个类是官方的源码
    }

-----------------------------------------------------OrleansConfiguration.xml----------------------

<?xml version="1.0" encoding="utf-8"?>
<OrleansConfiguration xmlns="urn:orleans">
  <Globals>
    <SystemStore SystemStoreType ="SqlServer"
                 DeploymentId="OrleansTest"
                 DataConnectionString="Data Source=.;Initial Catalog=OrleansTest;Integrated Security=True;Pooling=False;Max Pool Size=200;Asynchronous Processing=True;MultipleActiveResultSets=True;user id=sa;password=123456" AdoInvariant="System.Data.SqlClient" />
  </Globals>
  <Defaults>
    <Tracing DefaultTraceLevel="Info" TraceToConsole="true" TraceToFile="{0}-{1}.log" PropagateActivityId="false" BulkMessageLimit="1000">
      <TraceLevelOverride LogPrefix="Application" TraceLevel="Info" />
    </Tracing>
  </Defaults>
  <Override Node="delault1">
    <Networking Address="localhost" Port="22221" />
    <ProxyingGateway Address="localhost" Port="40001" />
  </Override>
  <Override Node="delault2">
    <Networking Address="localhost" Port="22222" />
    <ProxyingGateway Address="localhost" Port="40002" />
  </Override>
  <Override Node="delault3">
    <Networking Address="localhost" Port="22223" />
    <ProxyingGateway Address="localhost" Port="40003" />
  </Override>
</OrleansConfiguration>

-----------------------------------------------------------客户端-----------------------

using System;
using System.Threading.Tasks;

using Orleans;
using Orleans.Runtime.Configuration;
using Sample.GrainInterfaces;

namespace client
{
    /// <summary>
    /// Orleans test silo host
    /// </summary>
    public class Program
    {
        static void Main(string[] args)
        {
            // The Orleans silo environment is initialized in its own app domain in order to more
            // closely emulate the distributed situation, when the client and the server cannot
            // pass data via shared memory.


            GrainClient.Initialize();

            // TODO: once the previous call returns, the silo is up and running.
            //       This is the place your custom logic, for example calling client logic
            //       or initializing an HTTP front end for accepting incoming requests.

            while (true)
            {
                try
                {

                    Console.WriteLine("请输入用户的手机号码来判断是否存在:");
                    var mobileNumber = Console.ReadLine();
                    new Action(() => {

                        if (mobileNumber == "")
                            mobileNumber = new Random().Next(1, 10000).ToString();

                        var userService = GrainClient.GrainFactory.GetGrain<IGrain1>(new Random().Next(1, 10000));
                        Console.WriteLine($"用户{mobileNumber},{(userService.Exist(mobileNumber).Result ? "已经存在" : "还不存在")}");
                        if (mobileNumber == "exit")
                            GrainClient.Uninitialize();
                    }).BeginInvoke(null,null);

                }
                catch(Exception ex)
                {
                    Console.WriteLine($"err:{ex.ToString()}");
                }
            }
        }
    }
}

-------------------------------------------ClientConfiguration.xml--------------

<?xml version="1.0" encoding="utf-8" ?>
<ClientConfiguration xmlns="urn:orleans">
  <SystemStore SystemStoreType ="SqlServer"
                DeploymentId="OrleansTest"
                DataConnectionString="Data Source=.;Initial Catalog=OrleansTest;Integrated Security=True;Pooling=False;Max Pool Size=200;Asynchronous Processing=True;MultipleActiveResultSets=True;user id=sa;password=123456" AdoInvariant="System.Data.SqlClient" />
  <Tracing DefaultTraceLevel="Info" TraceToConsole="true" TraceToFile="{0}-{1}.log" WriteMessagingTraces="false" BulkMessageLimit="1000">
    <TraceLevelOverride LogPrefix="Runtime" TraceLevel="Info" />
    <TraceLevelOverride LogPrefix="Application" TraceLevel="Info" />
    <TraceLevelOverride LogPrefix="AssemblyLoader" TraceLevel="Warning" />
  </Tracing>
  <Messaging ResponseTimeout="30s" ClientSenderBuckets="8192" MaxResendCount="0" />
</ClientConfiguration>

286882181qqcom avatar Nov 09 '16 00:11 286882181qqcom

我开两个服务节点,然后我 非正常关闭其中一个后,另一个开始服务节点报错了

WARNING 101024 Runtime.Messaging.IncomingMessageAcceptor 127.0.0.1:22222] Exception while completing a receive from 127.0.0.1:1493
Exc level 0: System.Net.Sockets.SocketException: 远程主机强迫关闭了一个现有的连接。 在 System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult) 在 Orleans.Runtime.Messaging.IncomingMessageAcceptor.ReceiveCallback(IAsyncResult result) [2016-11-09 00:50:33.674 GMT 14 WARNING 101021 Runtime.Messaging.SiloMessageSender/SystemSender 127.0.0.1:22222] Exception getting a sending socket to endpoint S127.0.0.1:22221:216348552
Exc level 0: System.Net.Sockets.SocketException: 由于目标计算机积极拒绝,无法连接。 127.0.0.1:22221 在 System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) 在 System.Net.Sockets.Socket.Connect(EndPoint remoteEP) 在 Orleans.Runtime.SocketManager.SendingSocketCreator(IPEndPoint target) 在 Orleans.Runtime.LRU2.Get(TKey key) 在 Orleans.Runtime.Messaging.SiloMessageSender.GetSendingSocket(Message msg, Socket& socket, SiloAddress& targetSilo, String& error) [2016-11-09 00:50:33.723 GMT 11 WARNING 101802 DeploymentLoadPublisher 127.0.0.1:22222] An exception was thrown by PublishStatistics.UpdateRuntimeStatistics(). Ignoring. Exc level 0: Orleans.Runtime.OrleansException: Silo S127.0.0.1:22222:216348530 is rejecting message: Request S127.0.0.1:22222:216348530DeploymentLoadPublisherSystemTarget@S00000016->S127.0.0.1:22221:216348552DeploymentLoadPublisherSystemTarget@S00000016 #178: global::Orleans.Runtime.IDeploymentLoadPublisher:UpdateRuntimeStatistics(). Reason = Exception getting a sending socket to endpoint S127.0.0.1:22221:216348552 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.DeploymentLoadPublisher.<PublishStatistics>d__14.MoveNext() [2016-11-09 00:50:33.905 GMT 5 ERROR 100071 Dispatcher 127.0.0.1:22222] !!!!!!!!!! SelectTarget failed with Silo S127.0.0.1:22222:216348530 is rejecting message: Request S127.0.0.1:22222:216348530Catalog@S0000000e->S127.0.0.1:22221:216348552DirectoryService@S0000000a #181: global::Orleans.Runtime.IRemoteGrainDirectory:LookupAsync(). Reason = Recent (00:00:00.2065090 ago, at 2016-11-09 00:50:33.694 GMT) connection failure trying to reach target silo S127.0.0.1:22221:216348552. Going to drop Request msg 181 without sending. CONNECTION_RETRY_DELAY = 00:00:01. Exc level 0: Orleans.Runtime.OrleansException: Silo S127.0.0.1:22222:216348530 is rejecting message: Request S127.0.0.1:22222:216348530Catalog@S0000000e->S127.0.0.1:22221:216348552DirectoryService@S0000000a #181: global::Orleans.Runtime.IRemoteGrainDirectory:LookupAsync(). Reason = Recent (00:00:00.2065090 ago, at 2016-11-09 00:50:33.694 GMT) connection failure trying to reach target silo S127.0.0.1:22221:216348552. Going to drop Request msg 181 without sending. CONNECTION_RETRY_DELAY = 00:00:01. 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.GrainDirectory.LocalGrainDirectory.<LookupAsync>d__111.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Scheduler.SchedulerExtensions.<>c__DisplayClass0_01.<b__0>d.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Placement.RandomPlacementDirector.d__1.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Placement.PlacementDirectorsManager.d__11.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Dispatcher.d__32.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Dispatcher.d__29.MoveNext() [2016-11-09 00:50:34.640 GMT 13 WARNING 101021 Runtime.Messaging.SiloMessageSender/PingSender 127.0.0.1:22222] Exception getting a sending socket to endpoint S127.0.0.1:22221:216348552
Exc level 0: System.Net.Sockets.SocketException: 由于目标计算机积极拒绝,无法连接。 127.0.0.1:22221 在 System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) 在 System.Net.Sockets.Socket.Connect(EndPoint remoteEP) 在 Orleans.Runtime.SocketManager.SendingSocketCreator(IPEndPoint target) 在 Orleans.Runtime.LRU2.Get(TKey key) 在 Orleans.Runtime.Messaging.SiloMessageSender.GetSendingSocket(Message msg, Socket& socket, SiloAddress& targetSilo, String& error) [2016-11-09 00:50:34.662 GMT 11 WARNING 100613 MembershipOracle 127.0.0.1:22222] -Did not get ping response for ping #7 from S127.0.0.1:22221:216348552. Reason = Original Exc Type: Orleans.Runtime.OrleansException Message:Silo S127.0.0.1:22222:216348530 is rejecting message: Request S127.0.0.1:22222:216348530MembershipOracle@S0000000f->S127.0.0.1:22221:216348552MembershipOracle@S0000000f #180: global::Orleans.Runtime.IMembershipService:Ping(). Reason = Exception getting a sending socket to endpoint S127.0.0.1:22221:216348552 [2016-11-09 00:50:34.672 GMT 33 ERROR 100071 Dispatcher 127.0.0.1:22222] !!!!!!!!!! SelectTarget failed with Silo S127.0.0.1:22222:216348530 is rejecting message: Request S127.0.0.1:22222:216348530Catalog@S0000000e->S127.0.0.1:22221:216348552DirectoryService@S0000000a #182: global::Orleans.Runtime.IRemoteGrainDirectory:LookupAsync(). Reason = Recent (00:00:00.9777777 ago, at 2016-11-09 00:50:33.694 GMT) connection failure trying to reach target silo S127.0.0.1:22221:216348552. Going to drop Request msg 182 without sending. CONNECTION_RETRY_DELAY = 00:00:01. Exc level 0: Orleans.Runtime.OrleansException: Silo S127.0.0.1:22222:216348530 is rejecting message: Request S127.0.0.1:22222:216348530Catalog@S0000000e->S127.0.0.1:22221:216348552DirectoryService@S0000000a #182: global::Orleans.Runtime.IRemoteGrainDirectory:LookupAsync(). Reason = Recent (00:00:00.9777777 ago, at 2016-11-09 00:50:33.694 GMT) connection failure trying to reach target silo S127.0.0.1:22221:216348552. Going to drop Request msg 182 without sending. CONNECTION_RETRY_DELAY = 00:00:01. 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.GrainDirectory.LocalGrainDirectory.<LookupAsync>d__111.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Scheduler.SchedulerExtensions.<>c__DisplayClass0_01.<b__0>d.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Placement.RandomPlacementDirector.d__1.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Placement.PlacementDirectorsManager.d__11.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Dispatcher.d__32.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Dispatcher.d__29.MoveNext() [2016-11-09 00:50:35.734 GMT 14 WARNING 101021 Runtime.Messaging.SiloMessageSender/SystemSender 127.0.0.1:22222] Exception getting a sending socket to endpoint S127.0.0.1:22221:216348552
Exc level 0: System.Net.Sockets.SocketException: 由于目标计算机积极拒绝,无法连接。 127.0.0.1:22221 在 System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) 在 System.Net.Sockets.Socket.Connect(EndPoint remoteEP) 在 Orleans.Runtime.SocketManager.SendingSocketCreator(IPEndPoint target) 在 Orleans.Runtime.LRU2.Get(TKey key) 在 Orleans.Runtime.Messaging.SiloMessageSender.GetSendingSocket(Message msg, Socket& socket, SiloAddress& targetSilo, String& error) [2016-11-09 00:50:35.752 GMT 11 WARNING 101802 DeploymentLoadPublisher 127.0.0.1:22222] An exception was thrown by PublishStatistics.UpdateRuntimeStatistics(). Ignoring. Exc level 0: Orleans.Runtime.OrleansException: Silo S127.0.0.1:22222:216348530 is rejecting message: Request S127.0.0.1:22222:216348530DeploymentLoadPublisherSystemTarget@S00000016->S127.0.0.1:22221:216348552DeploymentLoadPublisherSystemTarget@S00000016 #183: global::Orleans.Runtime.IDeploymentLoadPublisher:UpdateRuntimeStatistics(). Reason = Exception getting a sending socket to endpoint S127.0.0.1:22221:216348552 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.DeploymentLoadPublisher.<PublishStatistics>d__14.MoveNext() [2016-11-09 00:50:35.753 GMT 34 ERROR 100071 Dispatcher 127.0.0.1:22222] !!!!!!!!!! SelectTarget failed with Silo S127.0.0.1:22222:216348530 is rejecting message: Request S127.0.0.1:22222:216348530Catalog@S0000000e->S127.0.0.1:22221:216348552DirectoryService@S0000000a #185: global::Orleans.Runtime.IRemoteGrainDirectory:LookupAsync(). Reason = Recent (00:00:00 ago, at 2016-11-09 00:50:35.751 GMT) connection failure trying to reach target silo S127.0.0.1:22221:216348552. Going to drop Request msg 185 without sending. CONNECTION_RETRY_DELAY = 00:00:01. Exc level 0: Orleans.Runtime.OrleansException: Silo S127.0.0.1:22222:216348530 is rejecting message: Request S127.0.0.1:22222:216348530Catalog@S0000000e->S127.0.0.1:22221:216348552DirectoryService@S0000000a #185: global::Orleans.Runtime.IRemoteGrainDirectory:LookupAsync(). Reason = Recent (00:00:00 ago, at 2016-11-09 00:50:35.751 GMT) connection failure trying to reach target silo S127.0.0.1:22221:216348552. Going to drop Request msg 185 without sending. CONNECTION_RETRY_DELAY = 00:00:01. 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.GrainDirectory.LocalGrainDirectory.<LookupAsync>d__111.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Scheduler.SchedulerExtensions.<>c__DisplayClass0_01.<b__0>d.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Placement.RandomPlacementDirector.d__1.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Placement.PlacementDirectorsManager.d__11.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Dispatcher.d__32.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Orleans.Runtime.Dispatcher.d__29.MoveNext()

在这个期间,客户端是无法调用的(阻塞了),要等一分种后才可以调用

286882181qqcom avatar Nov 09 '16 02:11 286882181qqcom

<Override Node="delault1">
    <Networking Address="localhost" Port="22221" />
    <ProxyingGateway Address="localhost" Port="40001" />
  </Override>
  <Override Node="delault2">
    <Networking Address="localhost" Port="22222" />
    <ProxyingGateway Address="localhost" Port="40002" />
  </Override>
  <Override Node="delault3">
    <Networking Address="localhost" Port="22223" />
    <ProxyingGateway Address="localhost" Port="40003" />
  </Override>

Are you trying to start 3 silos on the same machine? If so, are you setting SiloHost.Name for each of them to pick the right overrides?

sergeybykov avatar Nov 09 '16 17:11 sergeybykov

不,我是为了测试方便,才放在同一台服器上,正式上线是不同的服务器上

286882181qqcom avatar Nov 10 '16 00:11 286882181qqcom

This can't be correct: DataConnectionString="Data Source=.;Initial Catalog=OrleansTest;Integrated Security=True;Pooling=False;Max Pool Size=200;Asynchronous Processing=True;MultipleActiveResultSets=True;user id=sa;password=123456" AdoInvariant="System.Data.SqlClient" />.

I think the ADO.NET library should outright fail with an exception when both integrated security and user id (with password) are used simultaneously in the same connection string.

veikkoeeva avatar Nov 11 '16 14:11 veikkoeeva

Looking at the provided exception trace and what it looks like is not being able to connect to the ports, I wonder if the firewall blocks them? In my experience this is a common scenario when running a multi-silo setup in reliable configuration on one machine. This could be examined from Windows Event Log too, instructions to unblock: https://github.com/dotnet/orleans/tree/master/Samples (just in case).

veikkoeeva avatar Nov 11 '16 14:11 veikkoeeva

集群倒是没问题,配置下各种参数就行。 不过源代码没看太懂,似乎有c++的痕迹。 只有使用文档,没有设计思路的任何文档,只能在源码中考古,比较郁闷。

AlbertYi1980 avatar Nov 16 '16 15:11 AlbertYi1980

I'm with you, we should share design doc with our users IMO. We are working on it. The design doc currently exists only in people's mind ;) . We are working on make it on paper.

xiazen avatar Nov 16 '16 22:11 xiazen