summaryrefslogtreecommitdiff
path: root/app/workers
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@12-4-stable-eeGitLab Bot2019-10-22114-55/+273
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-09-185-5/+5
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-09-137-1/+14
|
* CE port for pipelines for external pull requestsce-detect-github-pull-requestsFabio Pitino2019-09-052-0/+26
| | | | | | | | | | | | | | | Detect if pipeline runs for a GitHub pull request When using a mirror for CI/CD only we register a pull_request webhook. When a pull_request webhook is received, if the source branch SHA matches the actual head of the branch in the repository we create immediately a new pipeline for the external pull request. Otherwise we store the pull request info for when the push webhook is received. When using "only/except: external_pull_requests" we can detect if the pipeline has a open pull request on GitHub and create or not the job based on that.
* Remove unnecessary freeze in appDinesh Panda2019-09-042-2/+2
|
* Merge branch 'master' into 'master'Stan Hu2019-08-231-1/+1
|\ | | | | | | | | Reduce dedup calls to gc only See merge request gitlab-org/gitlab-ce!32083
| * Reduce dedup calls to gc onlyBoris Krylov2019-08-221-1/+1
| |
* | Avoid conflicts between ArchiveTraceWorkersavoid-race-condition-of-archive-trace-cron-workerShinya Maeda2019-08-221-1/+1
|/ | | | | | This commits avoiding conflicts between ArchiveTraceWorker and ArchiveTracesCronWorker by changing the target of the latter worker.
* Merge branch 'dm-process-commit-worker-n+1' into 'master'Stan Hu2019-08-161-15/+2
|\ | | | | | | | | | | | | Look up upstream commits once before queuing ProcessCommitWorkers Closes #65464 See merge request gitlab-org/gitlab-ce!31871
| * Look up upstream commits once before queuing ProcessCommitWorkersDouwe Maan2019-08-161-15/+2
| | | | | | | | | | | | | | | | Instead of checking if a commit already exists in the upstream project in its ProcessCommitWorker and bailing out if it does, we check the existence of all commits in bulk in Git::BranchHooksService, so that we can skip scheduling ProcessCommitWorker jobs for those commits that already exist upstream entirely.
* | Expire project caches once per push instead of once per refStan Hu2019-08-162-6/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously `ProjectCacheWorker` would be scheduled once per ref, which would generate unnecessary I/O and load on Sidekiq, especially if many tags or branches were pushed at once. `ProjectCacheWorker` would expire three items: 1. Repository size: This only needs to be updated once per push. 2. Commit count: This only needs to be updated if the default branch is updated. 3. Project method caches: This only needs to be updated if the default branch changes, but only if certain files change (e.g. README, CHANGELOG, etc.). Because the third item requires looking at the actual changes in the commit deltas, we schedule one `ProjectCacheWorker` to handle the first two cases, and schedule a separate `ProjectCacheWorker` for the third case if it is needed. As a result, this brings down the number of `ProjectCacheWorker` jobs from N to 2. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52046
* | Add usage pings for source code pushesIgor2019-08-131-0/+1
| | | | | | | | Source Code Usage Ping for Create SMAU
* | Rework retry strategy for remote mirrorsBob Van Landuyt2019-08-132-30/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **Prevention of running 2 simultaneous updates** Instead of using `RemoteMirror#update_status` and raise an error if it's already running to prevent the same mirror being updated at the same time we now use `Gitlab::ExclusiveLease` for that. When we fail to obtain a lease in 3 tries, 30 seconds apart, we bail and reschedule. We'll reschedule faster for the protected branches. If the mirror already ran since it was scheduled, the job will be skipped. **Error handling: Remote side** When an update fails because of a `Gitlab::Git::CommandError`, we won't track this error in sentry, this could be on the remote side: for example when branches have diverged. In this case, we'll try 3 times scheduled 1 or 5 minutes apart. In between, the mirror is marked as "to_retry", the error would be visible to the user when they visit the settings page. After 3 tries we'll mark the mirror as failed and notify the user. We won't track this error in sentry, as it's not likely we can help it. The next event that would trigger a new refresh. **Error handling: our side** If an unexpected error occurs, we mark the mirror as failed, but we'd still retry the job based on the regular sidekiq retries with backoff. Same as we used to The error would be reported in sentry, since its likely we need to do something about it.
* | Only expire tag cache once per pushsh-only-flush-tags-once-per-pushStan Hu2019-08-131-0/+2
|/ | | | | | | | | | Previously each tag in a push would invoke the Gitaly `FindAllTags` RPC since the tag cache would be invalidated with every tag. We can eliminate those extraneous calls by expiring the tag cache once in `PostReceive` and taking advantage of the cached tags. Relates to https://gitlab.com/gitlab-org/gitlab-ce/issues/65795
* Merge branch '65803-invalidate-branches-cache-on-refresh' into 'master'Bob Van Landuyt2019-08-131-0/+3
|\ | | | | | | | | Only expire branch cache once per push See merge request gitlab-org/gitlab-ce!31653
| * Rename branches_exist? -> includes_branches?65803-invalidate-branches-cache-on-refreshStan Hu2019-08-091-1/+1
| |
| * Invalidate branches cache on PostReceivePatrick Bajao2019-08-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever `PostReceive` is enqueued, `UpdateMergeRequestsWorker` is enqueued and `MergeRequests::RefreshService` is called, it'll check if the source branch of each MR asssociated to the push exists or not via `MergeRequest#source_branch_exists?`. The said method will call `Repository#branch_exists?` which is cached in `Rails.cache`. When the cache contains outdated data and the source branch actually exists, the `MergeRequests#RefreshService` job will close associated MRs which is not correct. The fix is to expire the branches cache of the project so we have updated data during the post receive hook which will help in the accuracy of the check if we need to close associated MRs or not.
* | Remove unused `BuildProcessWorker`Kamil Trzciński2019-08-132-17/+0
|/ | | | | We migrated all logic to `PipelineProcessWorker` and this worker become redundant.
* Update reliable fetcherupdate-reliable-fetcherValery Sizov2019-08-061-0/+2
| | | | We added retry_count increment when job is recovered
* Merge branch 'prefer-to-use-process-pipeline-worker' into 'master'Sean McGivern2019-08-052-4/+5
|\ | | | | | | | | Extend PipelineProcessWorker to accept a list of builds See merge request gitlab-org/gitlab-ce!31425
| * Extend PipelineProcessWorker to accept a list of buildsprefer-to-use-process-pipeline-workerKamil Trzciński2019-08-022-4/+5
| | | | | | | | | | | | | | This changes used worker from `BuildProcessWorker` to `PipelineProcessWorker` to make pipeline processing much simpler. We process `pipeline_id`, based on some triggers.
* | Removes update_statistics_namespace feature flagMayra Cabrera2019-08-022-10/+2
|/ | | | | | | | After measuring the impact of the namespace storage on https://gitlab.com/gitlab-org/gitlab-ce/issues/64092. It was decided that it's performant enough. So we can freely remove the feature flag Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/64092
* Add support for DAGKamil Trzciński2019-08-012-0/+17
| | | | | | This implements the support for `needs:` keyword as part of GitLab CI. That makes some of the jobs to be run out of order.
* Further remove code branches by database typeAndreas Brandl2019-07-291-2/+0
| | | | | | | | We dropped MySQL support and a lot of mysql specific code has been removed in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/29608. This comes in from the other direction and removes any `if postgresql?` branches.
* Remove unused Clusters::RefreshServiceTiger2019-07-292-8/+2
| | | | | | Also removes all logic from ClusterConfigureWorker and ClusterProjectConfigureWorker, which are also no longer used.
* Validate the existence of archived traces before removing live tracesafe-archiving-for-tracesShinya Maeda2019-07-232-2/+2
| | | | | Often live traces are removed even though the archived trace doesn't exist. This commit checkes the existence strictly.
* Merge branch 'an-sidekiq-chaos' into 'master'Lin Jen-Shin2019-07-187-0/+75
|\ | | | | | | | | | | | | Adds chaos endpoints to Sidekiq Closes #64663 See merge request gitlab-org/gitlab-ce!30814
| * Adds chaos endpoints to Sidekiqan-sidekiq-chaosAndrew Newdigate2019-07-187-0/+75
| | | | | | | | | | This allows the chaos endpoints to be invoked in Sidekiq so that this environment can be tested for resilience.
* | Update usage ping cron behaviorbjk/usage_pingBen Kochie2019-07-181-0/+6
|/ | | | | | | * Splay the start by sleeping up to one minute. * Adjust sideikiq retries to try up to approximately three hours. * Randomize the minute fully within the hour. * Psudo-randomize the day of the week based on the instance UUID.
* Remove auto ssl feature flagsVladimir Shushlin2019-07-122-3/+3
| | | | | * remove feature flag for admin settings * remove feature flag for domain settings
* Add a rubocop for Rails.loggerMayra Cabrera2019-07-1018-18/+22
| | | | | | Suggests to use a JSON structured log instead Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/54102
* Add queue_size method to ApplicationWorkerdm-queue-mirror-jobs-in-batches-drain-ceDouwe Maan2019-07-051-0/+6
|
* Allow asynchronous rebase operations to be monitoredNick Thomas2019-07-041-0/+2
| | | | | | | | | This MR introduces tracking of the `rebase_jid` for merge requests. As with `merge_ongoing?`, `rebase_in_progress?` will now return true if a rebase is proceeding in sidekiq. After one release, we should remove the Gitaly-based lookup of rebases. It is much better to track this kind of thing via the database.
* Includes logic to persist namespace statisticsMayra Cabrera2019-07-024-0/+102
| | | | | | | | | | | | | | | | | | | | | - Add two new ActiveRecord models: - RootNamespaceStoragestatistics will persist root namespace statistics - NamespaceAggregationSchedule will save information when a new update to the namespace statistics needs to be scheduled - Inject into UpdateProjectStatistics concern a new callback that will call an async job to insert a new row onto NamespaceAggregationSchedule table - When a new row is inserted a new job is scheduled. This job will update call an specific service to update the statistics and after that it will delete thee aggregated scheduled row - The RefresherServices makes heavy use of arel to build composable queries to update Namespace::RootStorageStatistics attributes. - Add an extra worker to traverse pending rows on NAmespace::AggregationSchedule table and schedule a worker for each one of this rows. - Add an extra worker to traverse pending rows on NAmespace::AggregationSchedule table and schedule a worker for each one of this rows
* Use project depended feature flag for pages sslpages-ssl-project-aware-feature-flagVladimir Shushlin2019-06-252-6/+4
| | | | | Also add ::Gitlab::LetsEncrypt.enabled? shortcut and simplify it a lot
* Renew Let's Encrypt certificatesVladimir Shushlin2019-06-243-0/+31
| | | | | | | | Add index for pages domain ssl auto renewal Add PagesDomain.needs_ssl_renewal scope Add cron worker for ssl renewal Add worker for ssl renewal Add pages ssl renewal worker queues settings
* Merge branch 'remove_create_deployment_from_build_success_worker' into 'master'Douwe Maan2019-06-241-12/+0
|\ | | | | | | | | | | | | Remove deprecated call in BuildSuccessWorker Closes #63622 See merge request gitlab-org/gitlab-ce!29958
| * Remove deprecated call in BuildSuccessWorkerremove_create_deployment_from_build_success_workerThong Kuah2019-06-241-12/+0
| | | | | | | | | | We now create_deployment on Ci::Build create. No need to call create_deployment again
* | Merge branch '60617-enable-project-cluster-jit' into 'master'Thong Kuah2019-06-241-2/+0
|\ \ | |/ |/| | | | | Enable JIT Kubernetes resource creation for project level clusters See merge request gitlab-org/gitlab-ce!29515
| * Enable project-level JIT resource creation60617-enable-project-cluster-jitTiger2019-06-181-2/+0
| | | | | | | | | | | | | | | | | | | | Previously this behaviour was only available to group and instance-level clusters, as some project clusters relied on Kubernetes credentials being passed through to the runner instead of having their resources managed by GitLab (which is not available when using JIT). These clusters have been migrated to unmanaged, so resources can be created on demand for the remaining managed clusters.
* | Merge branch 'ce-12014-incremental-es-wiki-updates' into 'master'Nick Thomas2019-06-191-8/+15
|\ \ | | | | | | | | | | | | Backport of 12014-incremental-es-wiki-updates See merge request gitlab-org/gitlab-ce!29531
| * | Backport of 12014-incremental-es-wiki-updatesce-12014-incremental-es-wiki-updatesMario de la Ossa2019-06-181-8/+15
| |/ | | | | | | Bringing in the DB migration and some light changes for CE classes
* | Add 2nd response for container api bulk deleteSteve Abrams2019-06-181-26/+3
|/ | | | | | | The bulk delete api endpoint for container registries can only be called once per hour. If a user calls the endpoint more than once per hour, they will now receive a 400 error with a descriptive message.
* Delete unauthorized Todos when project is privateissue_49897Felipe Artur2019-06-051-2/+2
| | | | | Delete Todos for guest users when project visibility level is updated to private.
* Ensure DB is writable before continuing jobs11925-geo-sidekiq-nodes-try-to-run-jobs-even-thought-db-is-readonlyAsh McKenzie2019-06-052-0/+4
| | | | | | | In the context of a Geo setup, some jobs can be running on a Geo secondary where the database is read-only and therefore we should guard against various jobs attempting to write.
* Merge branch 'introduce-auto-merge-process-worker' into 'master'Thong Kuah2019-06-043-8/+17
|\ | | | | | | | | Introduce sidekiq worker for auto merge process See merge request gitlab-org/gitlab-ce!28780
| * Introduce sidekiq worker for auto merge processintroduce-auto-merge-process-workerShinya Maeda2019-06-043-8/+17
| | | | | | | | | | As we have a central domain for auto merge process today, we should use a single worker for any auto merge process.
* | Merge branch ↵Kamil Trzciński2019-06-042-39/+28
|\ \ | |/ |/| | | | | | | | | | | | | 'set-real-next-run-at-for-preventing-duplciate-pipeline-creations' into 'master' Make pipeline schedule worker resilient Closes gitlab-com/gl-infra/production#805 and #61955 See merge request gitlab-org/gitlab-ce!28407
| * Make pipeline schedule worker resilientset-real-next-run-at-for-preventing-duplciate-pipeline-creationsShinya Maeda2019-06-032-39/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, pipeline schedule worker is unstable because it's sometimes killed by excessive memory consumption. In order to improve the performance, we add the following fixes: 1. next_run_at is always real_next_run, which means the value always takes into account of worker's cron schedule 1. Remove exlusive lock. This is already covered by real_next_run change. 1. Use RunPipelineScheduleWorker for avoiding memory killer. Memory consumption is spread to the multiple sidekiq worker.
* | Abstract auto merge processesShinya Maeda2019-06-031-3/+4
|/ | | | | | | | | | | | We have one auto merge strategy today - Merge When Pipeline Succeeds. In order to add more strategies for Merge Train feature, we abstract the architecture to be more extensible. Removed arguments Fix spec