Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Bug 1111077 - Enforce FrontendHttpServer state to match .state file
Browse files Browse the repository at this point in the history
* Update GearStatePlugin to enforce stopped state on Frontend
  Http Server configuration
  • Loading branch information
jwhonce committed Jun 30, 2014
1 parent 012f772 commit d3834df
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions node-util/conf/watchman/plugins.d/gear_state_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ def apply(iteration)
restart(uuid) if change_state?(uuid)

when State::STOPPED
# If node idles gear then user does $(gear stop), frontend cannot be updated.
# This forces frontend to match .state file
# https://bugzilla.redhat.com/show_bug.cgi?id=1111077
frontend = OpenShift::Runtime::FrontendHttpServer.new(
OpenShift::Runtime::ApplicationContainer.from_uuid(uuid)
)
if frontend.idle?
@logger.info %Q(watchman gear #{uuid} httpd frontend server updated to reflect 'stopped' state)
frontend.unidle
end

if pids.empty?
reset_state(uuid)
else
Expand Down

0 comments on commit d3834df

Please sign in to comment.