Skip to content

Commit

Permalink
[XrdCl] Avoid race in postmaster QueryTransport
Browse files Browse the repository at this point in the history
  • Loading branch information
smithdh authored and amadio committed Jul 10, 2023
1 parent b6c02a5 commit 496a044
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/XrdCl/XrdClPostMaster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,15 @@ namespace XrdCl
AnyObject &result )
{
XrdSysRWLockHelper scopedLock( pImpl->pDisconnectLock );
PostMasterImpl::ChannelMap::iterator it =
pImpl->pChannelMap.find( url.GetChannelId() );
if( it == pImpl->pChannelMap.end() )
return Status( stError, errInvalidOp );
Channel *channel = it->second;
Channel *channel = 0;
{
XrdSysMutexHelper scopedLock2( pImpl->pChannelMapMutex );
PostMasterImpl::ChannelMap::iterator it =
pImpl->pChannelMap.find( url.GetChannelId() );
if( it == pImpl->pChannelMap.end() )
return Status( stError, errInvalidOp );
channel = it->second;
}

if( !channel )
return Status( stError, errNotSupported );
Expand Down

0 comments on commit 496a044

Please sign in to comment.