Community
Participate
Working Groups
In bug 219605 we decided to *not* add the repository to the list of known repositories when the create() methods are called. However, this leads to cases where multiple clients have different repository instances: Client 1 calls: IRepository repo = repositoryManager.create(...); Client 2 calls: IRepository repo - repositoryManager.load(...); Now client 2 has a different repository instance from client 1, for the same underlying repository in the file system. This leads to synchronization problems, and potentially lost data if both clients modify the repository. See bug 228806 for a particular example of this problem.
*** Bug 229370 has been marked as a duplicate of this bug. ***
We need to fix this for 3.4. This is causing several problems that are difficult to work around: - Could have multiple repository objects in memory for the same repository on disk - The repository manager doesn't know if the created repository is a system repository until the next time the repository is loaded. Almost every client that calls repositoryManager#create immediately calls repositoryManager#add. There is only one instance in the generator where the repository is created but not added to the manager. We can preserve this behavior by calling repositoryManager#remove(URL) to remove the created repository from the list of known repositories.
Created attachment 98387 [details] Fix
DJ, can you review?
John, I think the patch is incomplete. It doesn't contain the necessary change in the MetadataRepositoryManager to add the repos in the create call.
Created attachment 98486 [details] Updated patch You're right, something must have happened during patch export. Trying again.
Created attachment 98501 [details] Additional patch After testing I found one extra place where reconciler.dropins is going around the repositry manager create method and going directly to the repository factory. In this case it needs to add the concrete repository object to the manager, or the system property bit gets lost. With this extra fx, I never see system repositories in the available repositories view, even directly after first startup.
Fix released.
+1
Created attachment 98635 [details] dropins artifact repository patch We should use the same logic to directly add the artifact repositories that are created in the dropins reconciler.
+1 for Simon's additional patch. Released.
Running the latest code from HEAD (which should have this fix)...I'm seeing very strange behavior. For example, I have some repos disabled. I go to the installed software page and check for updates. After doing so, some of my disabled repos are now visible in the available list. I'm in the middle of something or I would try harder to get a repeatable test case, but wanted to mention I'm seeing really flaky repo behavior and see if anyone else has noticed.