Plugins SDK v5: fibersToUse can not be less than 0

I am getting the following error when starting the LoadBalancing application on an EC2 t2.micro instance, with Plugins SDK v5 beta
System.ArgumentException: fibersToUse can not be less 0
   at Photon.SocketServer.Concurrency.CPUResourceManager..ctor(Int32 fibersToUse, IFiberFactory fiberFactory) in H:\SvnContent\photon-socketserver-sdk-branches\sdk_5.0\src\Photon.SocketServer\Concurrency\CPUResourceManager.cs:line 55
   at Photon.SocketServer.ApplicationBase..ctor() in H:\SvnContent\photon-socketserver-sdk-branches\sdk_5.0\src\Photon.SocketServer\ApplicationBase.cs:line 127
   at Photon.LoadBalancing.MasterServer.MasterApplication..ctor() in H:\SvnContent\photon-socketserver-sdk-branches\sdk_5.0\src-server\Loadbalancing\LoadBalancing\MasterServer\MasterApplication.cs:line 55
 at...
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: fibersToUse can not be less 0
   at Photon.SocketServer.Concurrency.CPUResourceManager..ctor(Int32 fibersToUse, IFiberFactory fiberFactory) in H:\SvnContent\photon-socketserver-sdk-branches\sdk_5.0\src\Photon.SocketServer\Concurrency\CPUResourceManager.cs:line 55
   at Photon.SocketServer.ApplicationBase..ctor() in H:\SvnContent\photon-socketserver-sdk-branches\sdk_5.0\src\Photon.SocketServer\ApplicationBase.cs:line 127
   at Photon.LoadBalancing.MasterServer.MasterApplication..ctor() in H:\SvnContent\photon-socketserver-sdk-branches\sdk_5.0\src-server\Loadbalancing\LoadBalancing\MasterServer\MasterApplication.cs:line 55
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at PhotonHostRuntime.PhotonDomainManager.?????????????????????????????????????????.?????????????????????????????????????????(String , String , String , String , IPhotonApplicationSink , ILogToUnmanagedLog , IControlListeners )
   at PhotonHostRuntime.PhotonDomainManager.Start(String assemblyName, String typeName, String instanceName, String applicationName, IPhotonApplicationSink sink, ILogToUnmanagedLog logger, IControlListeners listenerControl)

This error occurs even if I use a clean install of the SDK, with none of my custom settings.

The error does not occur on my local machine.

Any help would be appreciated. I cannot use v4 because of a known issue with custom authentication.

Comments

  • Okay, so i dug into you guys source code. It seems like you are using a bit shift operator in the constructor for ApplicationBase
     this.EncryptionResourceManager = new CPUResourceManager(Environment.ProcessorCount >> 1, (IFiberFactory) null)
          {
            QueueLengthLimit = 1000
          };
    

    If my processor count is more than 2, this is fine as bit shift will return a positive number. However on the t2.micro instance, there is only one processor, so 1 >> 1 = 0.

    Perhaps this is the error.
  • Great analysis :). I am facing the same problem. I wonder if there is a workaround, would be nice for be able to test drive the server on free tier amazon instances.
  • hi, @OldPilgrim and @abb

    yeah, guys, this is known issue.
    I'm sorry to say that there is no workaround currently for this issue.

    you need two processors

    best,
    ilya
  • JohnTubeJohnTube mod
    edited May 20
    hey @chvetsov

    I wonder if the new version (Photon Server v5 RC1) fixes this?
  • yes, it should be fixed

    best,
    ilya
Sign In or Register to comment.