Skip to content

Commit

Permalink
[XrdCl] LocalFileHandler: be more robust in case PostMaster initializ…
Browse files Browse the repository at this point in the history
…ation failed, closes #1797.
  • Loading branch information
simonmichal committed Oct 7, 2022
1 parent ec959e0 commit 32ada89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/XrdCl/XrdClLocalFileHandler.cc
Expand Up @@ -201,7 +201,7 @@ namespace
// and return there is no need to execute this in the thread-pool
SyncResponseHandler *syncHandler =
dynamic_cast<SyncResponseHandler*>( handler );
if( syncHandler )
if( syncHandler || DefaultEnv::GetPostMaster() == nullptr )
{
syncHandler->HandleResponse( status, resp );
}
Expand Down Expand Up @@ -230,7 +230,6 @@ namespace XrdCl
LocalFileHandler::LocalFileHandler() :
fd( -1 )
{
jmngr = DefaultEnv::GetPostMaster()->GetJobManager();
}

//------------------------------------------------------------------------
Expand Down Expand Up @@ -767,15 +766,15 @@ namespace XrdCl
// and return there is no need to execute this in the thread-pool
SyncResponseHandler *syncHandler =
dynamic_cast<SyncResponseHandler*>( handler );
if( syncHandler )
if( syncHandler || DefaultEnv::GetPostMaster() == nullptr )
{
syncHandler->HandleResponse( st, resp );
return XRootDStatus();
}

HostList *hosts = pHostList.empty() ? 0 : new HostList( pHostList );
LocalFileTask *task = new LocalFileTask( st, resp, hosts, handler );
jmngr->QueueJob( task );
DefaultEnv::GetPostMaster()->GetJobManager()->QueueJob( task );
return XRootDStatus();
}

Expand Down
5 changes: 0 additions & 5 deletions src/XrdCl/XrdClLocalFileHandler.hh
Expand Up @@ -330,11 +330,6 @@ namespace XrdCl
char *body,
ResponseHandler *handler );

//---------------------------------------------------------------------
// Receives LocalFileTasks to handle them async
//---------------------------------------------------------------------
JobManager *jmngr;

//---------------------------------------------------------------------
// Internal filedescriptor, which is used by all operations after open
//---------------------------------------------------------------------
Expand Down

0 comments on commit 32ada89

Please sign in to comment.