1

I have an Azure Worker Role that spawns another process (System.Diagnostics.Process) for executing an *.exe file in the Virtual Machine.

The problem is that this execution fails after a few minutes without any Exception.

I tried to log in to the Virtual Machine and start the executable file from the command line and it works fine.

The executable file is a Fortran program that allocates all the memory that is going to use at the start of its execution.

Here is the code that starts the process:

Process p = new Process();

ProcessStartInfo startInfo = new ProcessStartInfo(strPath, strArguments);

startInfo.WorkingDirectory = strDir;

p.StartInfo = startInfo;

p.Start();

p.WaitForExit();

The program starts, does some work and ends unexpectedly. Any ideas on what may be killing this process?

  • In which part of your worker role are you calling this code? – knightpfhor Dec 18 '12 at 17:26
  • The worker role checks a queue every 60 seconds ( in the Run method ) and if there's a message it starts this process – Xavi Almolda Dec 18 '12 at 17:36
  • 1
    There's not enough information here to say what's going wrong, so you should try to gather more. If there is any logging from the program, check that or configure it. Also try checking the Windows Event Logs. If the program writes errors to StandardOutput and/or StandardError, then try capturing those as well. There's a good code sample for that [here](http://stackoverflow.com/a/7608823/76263). – Brian Reischl Dec 18 '12 at 19:17

1 Answers1

4

I've found the problem.

Redirecting the output I have been able to see that the application failed due to a "There is not enough space on the disk." error, even though I have plenty of disc space. The problem is that the application creates temporary files during its execution, and the temporary directory for the hosted service runs of space. I think this directory has a maximum size of 100 MB.

The solution is to configure a new local storage in the service definition and set the TMP and TEMP environment variables to this local storage on the RoleEntryPoint.OnStart method ( http://msdn.microsoft.com/en-us/library/windowsazure/hh134851.aspx ).