automated project creation fails with license exception when we run one process per language

We have been using sdl api to automate the sdl project creation. This has been working fine with a single process sweeping each language folder one by one.

We wanted to improve the overall efficieny of this by introducing one process per language so that  all language are processed concurrently. When we run this set up, we get the following license exception. Only one process gets the license and all other fails.

Sdl.ProjectAutomation.FileBased.LicensingException: License check failed, with
exception:
Sdl.Common.Licensing.Provider.Nalpeiron.NalpeironLicensingProviderException:
Cannot create license. - Unknown error
(Support reference: -130) ---> Sdl.Core.FileCheck.FileCheckException: Unknown
error
(Support reference: -130)
   at Sdl.Core.FileCheck.License.Authorize()
   at Sdl.Core.FileCheck.Product.GetLicenseWithoutConsumingSeatsOrUsages()
   at
Sdl.Common.Licensing.Provider.Nalpeiron.LicensingProvider.CreateProductLicense
(String serverAddress)


How can we resolve this. Can somebody help.

thanks.

 

Parents
  • Hi Rob,

    I had the same problem myself. It seems that the problem is caused by some common resource which all your processes try to access in the same time. As a solution just wrap a system wide Mutex around the code which instantiates your FileBasedProject , something like below:

                using (Mutex m = new Mutex(false, "SomeUniqueMutexName"))
                {
                    try
                    {
                        m.WaitOne();
                        ProjectInfo pi = new ProjectInfo();
                        FileBasedProject proj = new FileBasedProject(pi);
                    }
                    catch (Exception ex)
                    {
                        //some logging

                        throw ex;
                    }
                    finally
                    {
                        //some more cleanup

                        m.ReleaseMutex();
                    }
                }

    Regards,
    Adrian

Reply
  • Hi Rob,

    I had the same problem myself. It seems that the problem is caused by some common resource which all your processes try to access in the same time. As a solution just wrap a system wide Mutex around the code which instantiates your FileBasedProject , something like below:

                using (Mutex m = new Mutex(false, "SomeUniqueMutexName"))
                {
                    try
                    {
                        m.WaitOne();
                        ProjectInfo pi = new ProjectInfo();
                        FileBasedProject proj = new FileBasedProject(pi);
                    }
                    catch (Exception ex)
                    {
                        //some logging

                        throw ex;
                    }
                    finally
                    {
                        //some more cleanup

                        m.ReleaseMutex();
                    }
                }

    Regards,
    Adrian

Children
No Data