Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible concurrency problem with in memmory repositories #3257

Closed
laeubi opened this issue Dec 14, 2023 · 1 comment · Fixed by #3273
Closed

Possible concurrency problem with in memmory repositories #3257

laeubi opened this issue Dec 14, 2023 · 1 comment · Fixed by #3273

Comments

@laeubi
Copy link
Member

laeubi commented Dec 14, 2023

Seen in a PR run here

[ERROR] [b1a45b02-e62e-4055-bce8-326251dc43ac][extension>org.eclipse.tycho:tycho-maven-plugin:5.0.0-SNAPSHOT] Provisioning exception
org.eclipse.equinox.p2.core.ProvisionException: Repository already exists at memory:1702483609144.
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.fail (AbstractRepositoryManager.java:409)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.doCreateRepository (AbstractRepositoryManager.java:294)
    at org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRepositoryManager.createRepository (ArtifactRepositoryManager.java:66)
    at org.eclipse.tycho.p2maven.transport.RemoteArtifactRepositoryManager.createRepository (RemoteArtifactRepositoryManager.java:74)
    at org.eclipse.tycho.p2maven.transport.RemoteArtifactRepositoryManager.createRepository (RemoteArtifactRepositoryManager.java:29)
    at org.eclipse.equinox.internal.p2.repository.helpers.RepositoryHelper.createMemoryComposite (RepositoryHelper.java:130)
    at org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository.createMemoryComposite (CompositeArtifactRepository.java:61)
    at org.eclipse.tycho.p2tools.copiedfromp2.AbstractApplication.getCompositeArtifactRepository (AbstractApplication.java:268)
    at org.eclipse.tycho.p2tools.copiedfromp2.AbstractApplication.hasArtifactSources (AbstractApplication.java:280)
    at org.eclipse.tycho.p2tools.copiedfromp2.MirrorApplication.validate (MirrorApplication.java:337)
    at org.eclipse.tycho.p2tools.copiedfromp2.MirrorApplication.run (MirrorApplication.java:220)
    at org.eclipse.tycho.p2tools.MirrorApplicationServiceImpl.mirrorReactor (MirrorApplicationServiceImpl.java:180)
    at org.eclipse.tycho.plugins.p2.repository.AssembleRepositoryMojo.execute (AssembleRepositoryMojo.java:368)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at io.takari.maven.builder.smart.SmartBuilderImpl.buildProject (SmartBuilderImpl.java:209)
    at io.takari.maven.builder.smart.SmartBuilderImpl$ProjectBuildTask.run (SmartBuilderImpl.java:81)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:539)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
    at java.lang.Thread.run (Thread.java:840)
@laeubi
Copy link
Member Author

laeubi commented Dec 16, 2023

The issue is actually with P2 that tries to find a "new" id by looping through as long as a repository not exits. The problem is that this is not atomic and therefore can fail if the method is called often enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant