-
Bug
-
Resolution: Fixed
-
Low (View bug fix roadmap)
-
8.16.1, 8.20.0
-
None
-
8.16
-
5
-
Severity 3 - Minor
-
47
-
Issue Summary
Repositories are not sync after adding a new organisation during DvcsScheduledJob.syncOrganizations().
Steps to Reproduce
- Add a new organisation while DvcsScheduledJob.syncOrganizations() is running, for example add Thread.sleep() in this method RepositorySyncServiceImpl.syncReposWithUpdates() and while the thread is sleeping we have to add another organisation. In this case adding will be interrupted in RepositorySyncServiceImpl.syncRepositoryList() because of clusterLockService.getLockForName(SYNC_REPOSITORY_LIST_LOCK).
Expected Results
The sync works for all repos for all organisations.
Actual Results
Repositories for an organisation weren't added.
Workaround
Customer can change lastPolled for past date for example the beginning of 1970s. In column LAST_POLLED in AO_E8B6CC_ORGANIZATION_MAPPING table. After this sync of the organisation will be performed during next scheduled job.
Technical explanation:
When we add a new organization we create it and save into db in AddGithubOrganization.doAddOrganization() then we start RepositorySyncServiceImpl.syncRepositoryList() and in this method we stop because of the Lock. The organization was created but we didn't get any repositories. At the next scheduledJob we will iterate through organizations, get and synchronize repos with GithubCommunicator.getRepositoriesWithUpdates * and the problem is, that in the end of it there is a method filterRepositoriesWithUpdates() which iterates through repositories and check if pushed date of repo is after the date when organization was synchronized last time (field lastPolled into Organisation.class{*}) if yes this repo will be added to the list. And here is the issue, because when we created the organization we setted lastPolled date by default into DB and it always will be after the pushed date of all repos of this organization so we wouldn't get any repositories.
- relates to
-
JSWSERVER-21411 DVCS Running hourly sync job blocks adding repositories to newly added organization
-
- Closed
-
-
THOR-199 You do not have permission to view this issue