DIRACGrid/DIRAC — Issue #262: SiteDirector will not startup
Author: graciani
Created: 2011-11-04 16:03:46+00:00
State: open
Labels: Bug, WMS

In the current implementation, a newly installed SiteDirector Agent with already configured queues will failed to startup.

The problem is the following, AgentModule does the initialization in the following order:

def am_initialize( self, *initArgs ):
agentName = self.am_getModuleParam( 'fullName' )
result = self.initialize( *initArgs )
if result == None:
return S_ERROR( "Error while initializing %s module: initialize must return S_OK/S_ERROR" % agentName )
if not result[ 'OK' ]:
return S_ERROR( "Error while initializing %s: %s" % ( agentName, result[ 'Message' ] ) )
_checkDir( self.am_getControlDirectory() )
_checkDir( self.am_getWorkDirectory() )

which means first it calls the Agent initialize method and then creates the control and work Directories.

But the initialize method of the SiteDirector includes:

result = self.getQueues()

that uses:

qwDir = os.path.join( self.workingDirectory, queue )
if not os.path.exists( qwDir ):
os.mkdir( qwDir )

this fails since the AgentModule has not yet created the workingDir.

I think the best fix is to create call the getQueues method not in the initialize but on the beginExecution() method of the Agent that at the same time it will update the list of queues previous to each iteration.

Ricardo