summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix race conditions for AuthorizedProjectsWorkerrefresh-authorizations-fork-joinYorick Peterse2017-01-2535-29/+325
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two cases that could be problematic: 1. Because sometimes AuthorizedProjectsWorker would be scheduled in a transaction it was possible for a job to run/complete before a COMMIT; resulting in it either producing an error, or producing no new data. 2. When scheduling jobs the code would not wait until completion. This could lead to a user creating a project and then immediately trying to push to it. Usually this will work fine, but given enough load it might take a few seconds before a user has access. The first one is problematic, the second one is mostly just annoying (but annoying enough to warrant a solution). This commit changes two things to deal with this: 1. Sidekiq scheduling now takes places after a COMMIT, this is ensured by scheduling using Rails' after_commit hook instead of doing so in an arbitrary method. 2. When scheduling jobs the calling thread now waits for all jobs to complete. Solution 2 requires tracking of job completions. Sidekiq provides a way to find a job by its ID, but this involves scanning over the entire queue; something that is very in-efficient for large queues. As such a more efficient solution is necessary. There are two main Gems that can do this in a more efficient manner: * sidekiq-status * sidekiq_status No, this is not a joke. Both Gems do a similar thing (but slightly different), and the only difference in their name is a dash vs an underscore. Both Gems however provide far more than just checking if a job has been completed, and both have their problems. sidekiq-status does not appear to be actively maintained, with the last release being in 2015. It also has some issues during testing as API calls are not stubbed in any way. sidekiq_status on the other hand does not appear to be very popular, and introduces a similar amount of code. Because of this I opted to write a simple home grown solution. After all, all we need is storing a job ID somewhere so we can efficiently look it up; we don't need extra web UIs (as provided by sidekiq-status) or complex APIs to update progress, etc. This is where Gitlab::SidekiqStatus comes in handy. This namespace contains some code used for tracking, removing, and looking up job IDs; all without having to scan over an entire queue. Data is removed explicitly, but also expires automatically just in case. Using this API we can now schedule jobs in a fork-join like manner: we schedule the jobs in Sidekiq, process them in parallel, then wait for completion. By using Sidekiq we can leverage all the benefits such as being able to scale across multiple cores and hosts, retrying failed jobs, etc. The one downside is that we need to make sure we can deal with unexpected increases in job processing timings. To deal with this the class Gitlab::JobWaiter (used for waiting for jobs to complete) will only wait a number of seconds (30 by default). Once this timeout is reached it will simply return. For GitLab.com almost all AuthorizedProjectWorker jobs complete in seconds, only very rarely do we spike to job timings of around a minute. These in turn seem to be the result of external factors (e.g. deploys), in which case a user is most likely not able to use the system anyway. In short, this new solution should ensure that jobs are processed properly and that in almost all cases a user has access to their resources whenever they need to have access.
* Merge branch 'zj-mattermost-fixes' into 'master' Rémy Coutable2017-01-232-8/+8
|\ | | | | | | | | Mattermost fixes See merge request !8654
| * Fix Slack/Mattermost notifaction serviceszj-mattermost-fixesZ.J. van de Weg2017-01-201-7/+7
| |
| * Remove prefilled prefixZ.J. van de Weg2017-01-201-1/+1
| | | | | | | | Fixes, at least partially, gitlab-org/gitlab-ce#26755.
* | Merge branch 'patch-12' into 'master' Achilleas Pipinellis2017-01-221-1/+1
|\ \ | | | | | | | | | | | | correct the prometheus feature configuration according to https://gitlab.com/git… See merge request !8703
| * | correct the prometheus feature configuration according to ↵Marcello2017-01-221-1/+1
|/ / | | | | | | https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template#L1147
* | Merge branch '26622-fix-transient-failure-in-cycle_analytics_events_spec' ↵Robert Speicher2017-01-221-21/+14
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | into 'master' Make cycle_analytics_events_spec.rb side-effect free Closes #26622 See merge request !8594
| * | Make cycle_analytics_events_spec.rb side-effect free26622-fix-transient-failure-in-cycle_analytics_events_specRémy Coutable2017-01-161-21/+14
| | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Merge branch 'mr-widget-reload-fix' into 'master' Jacob Schatz2017-01-221-2/+2
|\ \ \ | | | | | | | | | | | | | | | | Merge request widget class names update See merge request !8700
| * | | Merge request widget class names updatemr-widget-reload-fixPhil Hughes2017-01-221-2/+2
| | | |
* | | | Update VERSION to 8.17.0-prev8.17.0.preJames Lopez2017-01-221-1/+1
| | | |
* | | | Update CHANGELOG.md for 8.16.0James Lopez2017-01-22128-509/+130
|/ / / | | | | | | [ci skip]
* | | Merge branch 'mr-widget-replace-body' into 'master' Jacob Schatz2017-01-221-1/+3
|\ \ \ | | | | | | | | | | | | | | | | Replace merge request widget body See merge request !8697
| * | | Replace merge request widget bodymr-widget-replace-bodyPhil Hughes2017-01-221-1/+3
| | | |
* | | | Merge branch 'docs/prometheus' into 'master' Achilleas Pipinellis2017-01-223-1/+109
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Add Prometheus docs See merge request !8699
| * | | | Add information on the dashboard and exporter portsAchilleas Pipinellis2017-01-221-1/+6
| | | | | | | | | | | | | | | | | | | | [ci skip]
| * | | | Expose Prometheus docs to the main READMEAchilleas Pipinellis2017-01-222-1/+7
| | | | | | | | | | | | | | | | | | | | [ci skip]
| * | | | Add Prometheus docsAchilleas Pipinellis2017-01-221-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/1237 Omnibus MR: https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/1227 Omnibus issue: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1481
* | | | | Merge branch 'merge-dropdown-this-context' into 'master' Jacob Schatz2017-01-223-1/+46
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | Fixed bug with merge immediately button not working See merge request !8696
| * | | | Added spec testsmerge-dropdown-this-contextPhil Hughes2017-01-221-0/+41
| | | | |
| * | | | Fixed bug with merge immediately button would not workPhil Hughes2017-01-222-1/+5
|/ / / / | | | | | | | | | | | | This was caused by using 'this' in a fat arrow function, so 'this' would not equal the jQuery element
* | | | Merge branch 'update-auto-deploy-templates' into 'master' Kamil Trzciński2017-01-221-0/+76
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Update autodeploy templates [ci skip] See merge request !8695
| * | | | Update autodeploy templates [ci skip]Kamil Trzcinski2017-01-221-0/+76
| | | | |
* | | | | Merge branch 'fix-upload-group-avatar' into 'master' Stan Hu2017-01-222-3/+3
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Button by itself will submit forms. Button type button willn't Closes #26999 See merge request !8694
| * | | | | Button by itself will submit forms. Button type button willn'tJacob Schatz2017-01-212-3/+3
|/ / / / /
* | | | | Merge branch 'revert-9cac0317' into 'master' Grzegorz Bizon2017-01-2212-141/+104
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Revert "Merge branch 'dont-persist-application-settings-in-test-env' into 'master'" See merge request !8690
| * | | | | Revert "Merge branch 'dont-persist-application-settings-in-test-env' into ↵Grzegorz Bizon2017-01-2112-141/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'master'" This reverts merge request !8573
* | | | | | Merge branch ↵Jacob Schatz2017-01-211-1/+9
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '26618-search-bar-dropdown-offset-should-not-go-past-search-bar-input' into 'master' Introduced an offset limit to prevent the dropdown from going far right Closes #26618 and #27023 See merge request !8679
| * | | | | Introduced an offset limit to prevent the dropdown from going far rightJose Ivan Vargas2017-01-211-1/+9
|/ / / / /
* | | | | Merge branch 'fix_auto_merging' into 'master' Grzegorz Bizon2017-01-214-26/+86
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Merge When Pipeline Succeeds immediate merge bug Closes #26969 See merge request !8685
| * | | | | Add Changelog for MWPS immediate merge bugfix_auto_mergingGrzegorz Bizon2017-01-211-0/+4
| | | | | |
| * | | | | Extend feature tests for merge when pipeline succeedsGrzegorz Bizon2017-01-211-9/+51
| | | | | |
| * | | | | Load ci_bundle javascripts in MWBS partialGrzegorz Bizon2017-01-211-0/+3
| | | | | |
| * | | | | Add event delegation to prevent events from not firing in certain states.Jacob Schatz2017-01-211-17/+28
| | | | | |
* | | | | | Merge branch 'issue-search-token-position' into 'master' Jacob Schatz2017-01-218-41/+165
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Filtered search input click back at token See merge request !8617
| * | | | | | Fixed issue with multiple words not filtering correctlyPhil Hughes2017-01-211-4/+1
| | | | | | |
| * | | | | | Fixed failing JS specsPhil Hughes2017-01-213-7/+17
| | | | | | |
| * | | | | | Places dropdown at cursor positionPhil Hughes2017-01-211-1/+2
| | | | | | |
| * | | | | | Added comments to regexPhil Hughes2017-01-211-0/+2
| | | | | | |
| * | | | | | Fixed bug with hint not showing when in middle of textPhil Hughes2017-01-214-22/+16
| | | | | | |
| * | | | | | Fixed caret not moving correctlyPhil Hughes2017-01-212-2/+2
| | | | | | |
| * | | | | | Fixed issue when label or milestone had spacePhil Hughes2017-01-213-6/+27
| | | | | | |
| * | | | | | Fixed bug replacing full input valuePhil Hughes2017-01-212-6/+9
| | | | | | |
| * | | | | | Added testsPhil Hughes2017-01-213-14/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed edge cases with changing value
| * | | | | | Teaspoon test fixPhil Hughes2017-01-211-3/+18
| | | | | | |
| * | | | | | Trigger filter on clickPhil Hughes2017-01-211-4/+11
| | | | | | |
| * | | | | | Fixed filter issuePhil Hughes2017-01-213-6/+6
| | | | | | |
| * | | | | | Correctly replaces string when selecting in dropdownPhil Hughes2017-01-213-24/+32
| | | | | | |
| * | | | | | Opens dropdown correctlyPhil Hughes2017-01-214-17/+27
| | | | | | |
| * | | | | | Filtered search input click back at tokenPhil Hughes2017-01-212-2/+15
| |/ / / / / | | | | | | | | | | | | | | | | | | Allows the user to click back around the filtered search input to change the previously searched terms