Uploaded image for project: 'GMAT'
  1. GMAT
  2. GMT-3817

Infinite MATLAB connection loop when license checkout fails

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: P2
    • Resolution: Unresolved
    • Affects Version/s: R2014a, R2015a, R2016a, R2017a, R2018A
    • Fix Version/s: Someday
    • Component/s: MATLAB Interface
    • Labels:
      None
    • Environment:

      Windows 7 Enterprise 64-bit
      2013-04-05 build

      Description

      Reported verbally by John Bez:

      If GMAT tries to connect to the MATLAB interface and MATLAB license checkout fails, GMAT continues to try to reconnect in an infinite loop.

      The only way to stop it is to kill the process.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            djcinsb Darrel Conway added a comment -

            I might have a way to reproduce this out here. Basically, I installed ML R2013a but did not activate the license, and the GMAT message window gets stuck in a loop that looks like this:

            Interpreting scripts from the file.
            ***** file: C:\gsfccode\GmatDevelopment\application\samples\NeedMatlab\Ex_CallMatlabFunctions.script
            Running mission...
            Please wait while MATLAB engine opens...
            Failed to open MATLAB engine ...
            Please wait while MATLAB engine opens...
            Failed to open MATLAB engine ...
            Please wait while MATLAB engine opens...
            Failed to open MATLAB engine ...
            Please wait while MATLAB engine opens...
            Failed to open MATLAB engine ...
            

            Is this the same thing you are reporting here?

            (I hit the stop button on the toolbar, and got to this message: "Interface Exception Thrown: **** ERROR **** Failed to open MATLAB engine" so I'm not sure it's the same behavior. Let me know.)

            Show
            djcinsb Darrel Conway added a comment - I might have a way to reproduce this out here. Basically, I installed ML R2013a but did not activate the license, and the GMAT message window gets stuck in a loop that looks like this: Interpreting scripts from the file. ***** file: C:\gsfccode\GmatDevelopment\application\samples\NeedMatlab\Ex_CallMatlabFunctions.script Running mission... Please wait while MATLAB engine opens... Failed to open MATLAB engine ... Please wait while MATLAB engine opens... Failed to open MATLAB engine ... Please wait while MATLAB engine opens... Failed to open MATLAB engine ... Please wait while MATLAB engine opens... Failed to open MATLAB engine ... Is this the same thing you are reporting here? (I hit the stop button on the toolbar, and got to this message: "Interface Exception Thrown: **** ERROR **** Failed to open MATLAB engine" so I'm not sure it's the same behavior. Let me know.)
            Hide
            djcinsb Darrel Conway added a comment - - edited

            I spent some time looking into this issue. The connection loop isn't actually infinite, as far as I can tell. The issue is that each time a CallMatlabFunction command is initialized, it looks for an open MATLAB engine. When it doesn't find one, it tries to open one, and if there is a license issue, that attempt fails. Each instance of the command is initialized twice when the Sandbox is loaded – once in the Sandbox::Initialize() method, and once someplace else that I didn't get tracked down. So even simple scripts, like the sample script Ex_CallMatlabFunctions – which has 2 CallMatlabFunction commands – show multiple engine startup failures (4 for this sample script). Maybe we should add code to the MatlabInterface to count the startup failures (clearing the counter on success) and let the Sandbox access that counter to determine if it should quit the initialization process.

            That approach seemed too risky to me for R2013a because it might produce unwanted side effects that we don't know to test for (at this writing we're already in the RC iteration cycles), but we ought to fix this issue early in the R2013b cycle, I think.

            Show
            djcinsb Darrel Conway added a comment - - edited I spent some time looking into this issue. The connection loop isn't actually infinite, as far as I can tell. The issue is that each time a CallMatlabFunction command is initialized, it looks for an open MATLAB engine. When it doesn't find one, it tries to open one, and if there is a license issue, that attempt fails. Each instance of the command is initialized twice when the Sandbox is loaded – once in the Sandbox::Initialize() method, and once someplace else that I didn't get tracked down. So even simple scripts, like the sample script Ex_CallMatlabFunctions – which has 2 CallMatlabFunction commands – show multiple engine startup failures (4 for this sample script). Maybe we should add code to the MatlabInterface to count the startup failures (clearing the counter on success) and let the Sandbox access that counter to determine if it should quit the initialization process. That approach seemed too risky to me for R2013a because it might produce unwanted side effects that we don't know to test for (at this writing we're already in the RC iteration cycles), but we ought to fix this issue early in the R2013b cycle, I think.

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: