Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !5191

Merged
Created Sep 26, 2013 by Administrator@rootOwner

[gitlab:check] Fix detecting the status of sidekiq

  • Overview 6
  • Commits 1
  • Changes 1

Created by: jojosch

If you are running another sidekiq instance on your server, e.g. GitLab CI, the check script would parse the output of ps aux searching for sidekiq and returning success, although the GitLab sidekiq may not be running.

Now the ps call will only print the processes run by the GitLab user.


Old behavior:

(uid 1004 = gitlab_ci)

git@server2-2:~/gitlab|master ⇒  ps aux | grep -i sidekiq                         
1004     16523  1.6  1.5 406668 78680 pts/0    Sl   16:06   0:07 sidekiq 2.14.0 gitlab-ci [0 of 25 busy]                                                                                                                     
git      16823  2.6  2.7 571488 141880 pts/0   Sl   16:06   0:11 sidekiq 2.14.0 gitlab [0 of 25 busy]                                                                                                                                                             

Output of check:

[SNIP]
Checking Sidekiq ...

Running? ... yes

Checking Sidekiq ... Finished
[SNIP]

Now if for some reason the GitLab sidekiq would crash, the ps would look like this:

git@server2-2:~/gitlab|master ⇒  ps aux | grep -i sidekiq     
1004     16523  1.3  1.5 406668 78684 pts/0    Sl   16:06   0:08 sidekiq 2.14.0 gitlab-ci [0 of 25 busy]                                                                                                                     

Output of check: (since grep -i sidekiq would still return a result)

[SNIP]
Checking Sidekiq ...

Running? ... yes

Checking Sidekiq ... Finished
[SNIP]

New behavior:


Output of check:

[SNIP]
Checking Sidekiq ...

Running? ... no
  Try fixing it:
  sudo -u git -H bundle exec rake sidekiq:start RAILS_ENV=production
  For more information see:
  doc/install/installation.md in section "Install Init Script"
  see log/sidekiq.log for possible errors
  Please fix the error above and rerun the checks.

Checking Sidekiq ... Finished
[SNIP]
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/jojosch/fix-check-script-sidekiq