Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

NEXUS-5654 fixed deadlock during concurrent deploy

Propagation of prefix file changes from members to group repositories
was acquiring read-lock on all group members while holding write-lock
on one of the members. Two such changes executed concurrently for
different members of the same group will almost certainly result in
deadlock. Solution is to execution group prefix file update on a
separate thread.

Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
  • Loading branch information...
commit 7379216d5e9e8f2939fa6c3393a742910642b9b5 1 parent 1a7d987
ifedorenko ifedorenko authored
16 nexus-core/src/main/java/org/sonatype/nexus/proxy/maven/routing/internal/ManagerImpl.java
View
@@ -1166,18 +1166,10 @@ protected void propagatePrefixFileUpdateOf( final MavenRepository mavenRepositor
containingGroupRepository = groupRepository.adaptToFacet( MavenGroupRepository.class );
if ( mavenRepository != null )
{
- try
- {
- // this is a group, so we go with sync method as this is quick
- updateAndPublishPrefixFile( containingGroupRepository, false );
- }
- catch ( IOException e )
- {
- getLogger().warn(
- "Problem while cascading prefix file update to group repository {} from it's member {}",
- RepositoryStringUtils.getHumanizedNameString( containingGroupRepository ),
- RepositoryStringUtils.getHumanizedNameString( mavenRepository ), e );
- }
+ // this method is invoked while holding write lock on mavenRepository
+ // group prefix file will need read lock on all members
+ // to avoid deadlocks we push group prefix file update to another thread
+ doUpdatePrefixFileAsync( true, containingGroupRepository );
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.