summaryrefslogtreecommitdiff
path: root/app/workers
Commit message (Collapse)AuthorAgeFilesLines
* Fix high CPU usage when PostReceive receives refs/merge-requests/<id>push-refKamil Trzcinski2016-04-111-1/+1
|
* Exclude projects pending deletion from all resultsZeger-Jan van de Weg2016-03-311-1/+1
|
* Check if repo exists before attempting to update cache infoStan Hu2016-03-271-0/+3
| | | | Closes #14361
* Cache output of Repository#exists?Yorick Peterse2016-03-191-2/+3
| | | | | | | | | This caches the output of Repository#exists? in Redis while making sure it's flushed properly when creating new repositories, deleting them, etc. For the ProjectWiki tests to work I had to make ProjectWiki#create_repo! public as testing private methods in RSpec is a bit of a pain.
* Merge branch 'no-gc-retry' into 'master' Robert Speicher2016-03-181-0/+10
|\ | | | | | | | | | | | | | | Do not retry "git gc" To prevent 'git gc' timing out on a large repo and then bouncing around in the retry queue. See merge request !3266
| * Do not retry "git gc"Jacob Vosmaer2016-03-171-0/+10
| |
* | Back-porting PostReceive refactor made for EE 🍺Gabriel Mazetto2016-03-171-27/+19
| |
* | Add ability to delete a user with forceZeger-Jan van de Weg2016-03-151-2/+2
| |
* | A worker deletes a user, so the request doesn't time outZeger-Jan van de Weg2016-03-151-0/+10
|/ | | | Fixes #13261
* Use Gitlab::Git::DiffCollectionsJacob Vosmaer2016-03-031-1/+1
|
* Moved cache expiration code to Repository hooksYorick Peterse2016-02-232-2/+2
| | | | | This keeps all the cache expiration code in a single file/class instead of spreading it all across the codebase.
* Merge branch 'fix/gitpushservice-complexity-issue' into 'master' Douwe Maan2016-02-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce code complexity on GitPushService#execute Code complexity for gitlab-ce after this has been refactored: ``` 27.3: GitPushService#execute ``` This still needs to be merged into `gitlab-ee` presumably with conflicts... Perhaps we should create another issue for doing that? I left the code sort of similar to what it was... If I could, I would have refactored most of the code into separate classes, etc. as it breaks probably all SOLID principles. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/13327 See merge request !2784
| * refactored some stuff based on MR feedbackJames Lopez2016-02-171-6/+1
| |
| * refactored GitPushService and updated specJames Lopez2016-02-151-1/+6
| |
| * attempt to reduce code complexity on GitPushService#executeJames Lopez2016-02-111-1/+1
| |
* | Expire caches after forking/importing a repositoryYorick Peterse2016-02-172-0/+2
|/ | | | | | | | This ensures the caches for Repository#empty? and Repository#has_visible_content? are flushed after a repository has been imported or forked. Fixes gitlab-org/gitlab-ce#13505
* First pass at deleting projects in the background.Josh Frye2016-01-291-0/+17
|
* [WIP] Background process note logic for #3948Josh Frye2016-01-281-0/+12
|
* Extract Projects::ImportService service from RepositoryImportWorkerDouglas Barbosa Alexandre2016-01-251-39/+7
|
* Write to InfluxDB directly via UDPYorick Peterse2015-12-291-33/+0
| | | | | | | | | | | | | This removes the need for Sidekiq and any overhead/problems introduced by TCP. There are a few things to take into account: 1. When writing data to InfluxDB you may still get an error if the server becomes unavailable during the write. Because of this we're catching all exceptions and just ignore them (for now). 2. Writing via UDP apparently requires the timestamp to be in nanoseconds. Without this data either isn't written properly. 3. Due to the restrictions on UDP buffer sizes we're writing metrics one by one, instead of writing all of them at once.
* Drop empty tag values from metricsYorick Peterse2015-12-171-1/+5
| | | | | InfluxDB throws an error when trying to store a list of tags where one or more have an empty value.
* Cast values to strings before escaping themYorick Peterse2015-12-171-1/+1
| | | | | This ensures that e.g. line numbers used in tags are first casted to strings.
* Storing of application metrics in InfluxDBYorick Peterse2015-12-171-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the ability to write application metrics (e.g. SQL timings) to InfluxDB. These metrics can in turn be visualized using Grafana, or really anything else that can read from InfluxDB. These metrics can be used to track application performance over time, between different Ruby versions, different GitLab versions, etc. == Transaction Metrics Currently the following is tracked on a per transaction basis (a transaction is a Rails request or a single Sidekiq job): * Timings per query along with the raw (obfuscated) SQL and information about what file the query originated from. * Timings per view along with the path of the view and information about what file triggered the rendering process. * The duration of a request itself along with the controller/worker class and method name. * The duration of any instrumented method calls (more below). == Sampled Metrics Certain metrics can't be directly associated with a transaction. For example, a process' total memory usage is unrelated to any running transactions. While a transaction can result in the memory usage going up there's no accurate way to determine what transaction is to blame, this becomes especially problematic in multi-threaded environments. To solve this problem there's a separate thread that takes samples at a fixed interval. This thread (using the class Gitlab::Metrics::Sampler) currently tracks the following: * The process' total memory usage. * The number of file descriptors opened by the process. * The amount of Ruby objects (using ObjectSpace.count_objects). * GC statistics such as timings, heap slots, etc. The default/current interval is 15 seconds, any smaller interval might put too much pressure on InfluxDB (especially when running dozens of processes). == Method Instrumentation While currently not yet used methods can be instrumented to track how long they take to run. Unlike the likes of New Relic this doesn't require modifying the source code (e.g. including modules), it all happens from the outside. For example, to track `User.by_login` we'd add the following code somewhere in an initializer: Gitlab::Metrics::Instrumentation. instrument_method(User, :by_login) to instead instrument an instance method: Gitlab::Metrics::Instrumentation. instrument_instance_method(User, :save) Instrumentation for either all public model methods or a few crucial ones will be added in the near future, I simply haven't gotten to doing so just yet. == Configuration By default metrics are disabled. This means users don't have to bother setting anything up if they don't want to. Metrics can be enabled by editing one's gitlab.yml configuration file (see config/gitlab.yml.example for example settings). == Writing Data To InfluxDB Because InfluxDB is still a fairly young product I expect the worse. Data loss, unexpected reboots, the database not responding, you name it. Because of this data is _not_ written to InfluxDB directly, instead it's queued and processed by Sidekiq. This ensures that users won't notice anything when InfluxDB is giving trouble. The metrics worker can be started in a standalone manner as following: bundle exec sidekiq -q metrics The corresponding class is called MetricsWorker.
* Migrate CI WebHooks and Emails to new tablesKamil Trzcinski2015-12-101-1/+1
|
* Migrate CI::Services and CI::WebHooks to Services and WebHooksKamil Trzcinski2015-12-104-38/+19
|
* Merge branch 'master' into zj/gitlab-ce-merge-if-greenDouwe Maan2015-12-081-3/+0
|\
| * Migrate from Sidetiq to Sidekiq-cronfeature/sidekiq-cronGabriel Mazetto2015-12-041-3/+0
| | | | | | | | Updated Sidekiq to 3.5.x
* | Merge branch 'master' into merge-if-greenZeger-Jan van de Weg2015-12-075-35/+48
|\ \ | |/
| * fix specsrails_update_to_4_2Valery Sizov2015-11-301-1/+1
| |
| * Migrate mailers to ActiveJobValery Sizov2015-11-261-1/+1
| |
| * Rails update to 4.2.4Valery Sizov2015-11-251-1/+1
| |
| * Fix 500 when using CIci-fix-500Kamil Trzcinski2015-11-231-0/+3
| | | | | | | | | | | | - Fix for Ci::Build state machine, allowing to process builds without the project - Forcefully update builds that didn't want to update with state machine - Fix saving GitLabCiService as Admin Template
| * Remove accidentally added line. #3598issue_3598Rubén Dávila2015-11-201-3/+0
| | | | | | | | It should exist in EE only.
| * Remove unused variable in repository importDouwe Maan2015-11-181-1/+1
| |
| * Store and show reason why import failed.Douwe Maan2015-11-182-34/+47
| |
* | Merge branch 'master' into merge-if-greenZeger-Jan van de Weg2015-11-181-0/+18
|\ \ | |/
| * Cleanup stuck CI builds dailydrop-old-buildsKamil Trzcinski2015-11-031-0/+18
| |
* | API support, incorporated feedbackZeger-Jan van de Weg2015-11-181-11/+2
|/
* Remove unused sidekiq workerJacob Vosmaer2015-10-201-43/+0
|
* Clear archive cache asynchronouslyJacob Vosmaer2015-10-201-0/+9
|
* Rename reply_by_email to incoming_email to prepare for the future.Douwe Maan2015-09-211-1/+1
|
* remove API calls from CE to CIci_closer_integrationValery Sizov2015-09-181-12/+0
|
* Merge remote-tracking branch 'origin/master' into ↵Kamil Trzcinski2015-09-151-0/+34
|\ | | | | | | | | | | | | ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-g # Conflicts: # Gemfile.lock
| * Import forked repositories asynchronously to prevent large repositories from ↵Stan Hu2015-09-111-0/+34
| | | | | | | | | | | | | | | | | | timing out Use import_status to track async import status and give feedback to the user Closes #2388 Closes #2400
* | Merge branch 'master' into ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-gDmitriy Zaporozhets2015-09-092-13/+26
|\ \ | |/
| * FogBugz project importJared Szechy2015-09-081-13/+22
| |
| * Expire cache when merge request source branch was removedfix-branches-cache-after-mergeDmitriy Zaporozhets2015-08-281-0/+4
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Merge branch 'master' into ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-gDouwe Maan2015-08-262-14/+21
|\ \ | |/
| * Merge branch 'handle-smtp-input-errors' into 'master'Dmitriy Zaporozhets2015-08-251-14/+19
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries ### What does this MR do? This MR gracefully handles SMTP input errors (e.g. incorrect or invalid e-mail addresses) to prevent these types of exceptions from causing Sidekiq to retry the task. If these specific exceptions occur, they will be logged, and the e-mail will be dropped from the queue. ### Why was this MR needed? If you include an author that has a misspelled e-mail address, Sidekiq will keep sending e-mail to all the recipients even if they have already received the e-mail. The only way to recover is to clear the Sidekiq queue. Note that other exceptions can still be thrown (e.g. `IOError`, `Net::SMTPAuthenticationError`, `Net::SMTPServerBusy`, `Net::SMTPUnknownError`, and `TimeoutError`). If the worker encounters these, Sidekiq should retry the task. ### What are the relevant issue numbers? Closes https://github.com/gitlabhq/gitlabhq/issues/9560 See merge request !1163
| | * Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to ↵Stan Hu2015-08-191-14/+19
| | | | | | | | | | | | | | | | | | prevent Sidekiq retries Closes https://github.com/gitlabhq/gitlabhq/issues/9560