AWS Thinkbox Discussion Forums

ShutdownMonitoredManagedProcess not always working?

Found a machine that had a stray max process running (task manager screenshot):

That i tracked to a job it was rendeirng last night.

2014-07-30 20:49:34:  0: INFO: Executable: "C:\3ds Max 2012\3dsmax.exe"
2014-07-30 20:49:34:  0: INFO: Argument:  -p "dl.ini" -q -s "C:\Users\scanlinevfx\AppData\Local\Thinkbox\Deadline6\slave\LAPRO0904\plugins\53d96725bb649a1c2c8baedf\deadlineStartupMax2012.max"

From the logs, this is what i see:

2014-07-30 21:14:52:  Scheduler - Successfully dequeued 1 task(s).  Returning.
2014-07-30 21:14:52:  0: Shutdown
2014-07-30 21:14:53:  0: Exited ThreadMain(), cleaning up...
2014-07-30 21:14:53:  0: INFO: End Job called - shutting down 3dsmax plugin
2014-07-30 21:14:53:  0: Shutdown
2014-07-30 21:14:53:  0: Shutdown
2014-07-30 21:14:54:  0: Shutdown
2014-07-30 21:14:54:  0: Shutdown
2014-07-30 21:14:55:  0: Shutdown
2014-07-30 21:14:55:  0: Shutdown
2014-07-30 21:14:56:  0: Shutdown
2014-07-30 21:14:56:  0: Shutdown
2014-07-30 21:14:57:  0: Shutdown
2014-07-30 21:14:57:  0: Shutdown
2014-07-30 21:14:58:  0: WARNING: Timed out waiting for the renderer to close.
2014-07-30 21:14:58:  0: WARNING: Did not receive a success message in response to EndJob: 
2014-07-30 21:14:58:  0: INFO: Disconnecting socket connection to 3dsmax
2014-07-30 21:14:58:  0: INFO: Waiting for 3dsmax to shut down
2014-07-30 21:14:58:  0: INFO: 3dsmax has shut down
2014-07-30 21:14:58:  0: Stopped job: [SEA] SQU_039_8820_v0022_lle_EmitLonger_S04_images_render3d_FL-SprayMistPointsS04_0 
2014-07-30 21:14:58:  0: Unloading plugin: 3dsmax

In the 3dsmax plugin, this is the shutdown code:

    def ShutdownMax( self ):
        self.DeletePluginInis()
        
        self.Plugin.LogInfo( "Disconnecting socket connection to 3dsmax" )
        try:
            if self.MaxSocket != None:
                self.MaxSocket.Disconnect( True )
        except Exception, e:
            self.Plugin.LogWarning( "Error disconnecting socket connection to 3dsmax: %s" % e.Message )
        
        if( not self.Plugin.MonitoredManagedProcessIsRunning( self.ProgramName ) ):
            self.Plugin.LogWarning( "The 3ds max process has already quit" )
        else:
            #processIDs = self.Plugin.GetMonitoredManagedProcessIDs( self.ProgramName )
            #self.Plugin.LogInfo( "3dsmax process has %d objects" % len( processIDs ) )
            
            self.Plugin.LogInfo( "Waiting for 3dsmax to shut down" )
            self.Plugin.ShutdownMonitoredManagedProcess( self.ProgramName )
            #SystemUtils.Sleep( 10000 )
            
            #self.Plugin.LogInfo( "Terminating 3dsmax child processes" )
            #for id in processIDs:
            #    ProcessUtils.KillParentAndChildProcesses( id )
            
            #self.Plugin.ShutdownMonitoredManagedProcess( self.ProgramName )
            
            self.Plugin.LogInfo( "3dsmax has shut down" )

Does it check & confirm that the process ID is actually gone?

cheers
laszlo

We have a reference to the process object, and that shutdown function will only return once that process object’s states it’s no longer running. On windows, we’re using GetExitCodeProcess (msdn.microsoft.com/en-us/library … 89(v=vs.85.aspx), and we only return if this does not return STILL_ACTIVE.

So unless the system got confused in this case, that function should never have returned if 3dsmax.exe was still running…

Well… it did :slight_smile:

Privacy | Site terms | Cookie preferences