Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mitigate case of starting an existing supervisord process group success reported as failure. #36972

Merged
merged 1 commit into from Oct 17, 2016
Merged

Conversation

zer0def
Copy link
Contributor

@zer0def zer0def commented Oct 13, 2016

What does this PR do?

Fixes a situation where attempts at starting an existing supervisord process group succeed, but report failure.

What issues does this PR fix or reference?

No reported issue at this time.

Reference SLS:

asdf-task-setup:
  pkg.installed:
    - name: supervisor
    - refresh: true
  service.running:
    - name: supervisor
    - enable: true
    - require:
      - pkg: asdf-task-setup
  file.managed:
    - name: /etc/supervisor/conf.d/asdf.conf
    - contents: |
        [program:asdf]
        command = /bin/bash -c 'while true; do sleep 15; done'
        autostart = true
        autorestart = true
        numprocs = 2
        process_name = %(program_name)s_%(process_num)s
    - require:
      - pkg: asdf-task-setup
  module.run:
    - name: supervisord.update
    - require:
      - service: asdf-task-setup

asdf-task-stop:
  supervisord.dead:
    - name: 'asdf:'
    - require:
      - module: asdf-task-setup

asdf-task-start:
  supervisord.running:
    - name: 'asdf:'
    - update: true
    - require:
      - supervisord: asdf-task-stop

Previous Behavior

Minion log:

2016-10-13 05:33:52,233 [salt.loaded.int.module.cmdmod][INFO    ][31522] Executing command ['/usr/bin/supervisorctl', 'reread'] in directory '/root'
2016-10-13 05:33:52,382 [salt.loaded.int.module.cmdmod][INFO    ][31522] Executing command ['/usr/bin/supervisorctl', 'add', 'asdf'] in directory '/root'
2016-10-13 05:33:52,506 [salt.loaded.int.module.cmdmod][DEBUG   ][31522] stdout: ERROR: process group already active
2016-10-13 05:33:52,507 [salt.loaded.int.states.supervisord][DEBUG   ][31522] Adding service: asdf:
2016-10-13 05:33:52,508 [salt.loaded.int.states.supervisord][DEBUG   ][31522] Starting: asdf:
2016-10-13 05:33:52,509 [salt.loaded.int.module.cmdmod][INFO    ][31522] Executing command ['/usr/bin/supervisorctl', 'start', 'asdf:'] in directory '/root'
2016-10-13 05:33:54,227 [salt.loaded.int.module.cmdmod][DEBUG   ][31522] stdout: asdf: started
2016-10-13 05:33:54,228 [salt.loaded.int.states.supervisord][DEBUG   ][31522] asdf: started
2016-10-13 05:33:54,228 [salt.state       ][ERROR   ][31522] Starting: asdf:
2016-10-13 05:33:54,229 [salt.state       ][INFO    ][31522] Completed state [asdf:] at time 05:33:54.228637 duration_in_ms=2136.438

SLS run output:

ubuntu16:
  Name: supervisor - Function: pkg.installed - Result: Clean
  Name: supervisor - Function: service.running - Result: Clean
  Name: /etc/supervisor/conf.d/asdf.conf - Function: file.managed - Result: Clean
  Name: supervisord.update - Function: module.run - Result: Changed
  Name: asdf: - Function: supervisord.dead - Result: Changed
----------
          ID: asdf-task-start
    Function: supervisord.running
        Name: asdf:
      Result: False
     Comment: Starting: asdf:
     Started: 09:31:11.083948
    Duration: 2226.972 ms
     Changes:

New Behavior

SLS run output:

ubuntu16:
  Name: supervisor - Function: pkg.installed - Result: Clean
  Name: supervisor - Function: service.running - Result: Clean
  Name: /etc/supervisor/conf.d/asdf.conf - Function: file.managed - Result: Clean
  Name: supervisord.update - Function: module.run - Result: Changed
  Name: asdf: - Function: supervisord.dead - Result: Changed
  Name: asdf: - Function: supervisord.running - Result: Changed

Tests written?

No

@zer0def zer0def changed the title Mitigate case of starting an existing supervisord process group succeeding, but reporting failure. Mitigate case of starting an existing supervisord process group success reported as failure. Oct 13, 2016
@cachedout cachedout merged commit 7f5aced into saltstack:2015.8 Oct 17, 2016
@cachedout
Copy link
Contributor

Thank you, @zer0def

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants