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

(PUP-2987) Windows service hangs #2936

Conversation

Projects
None yet
3 participants
@Iristyle
Copy link
Member

commented Aug 4, 2014

In conjunction with changes made in several other PRs, this at least prevents the service code from deadlocking in a STOP_PENDING state. When in this state, the service code needs to be forcefully have its process terminated before the service can become responsive. In practice, this issue appeared to be more reproducible in Ruby 2.0.0 x64.

Note that the changes to the win32-gem are a workaround until it can be discovered where the race exists in the code, and why Service_Main of the win32-service gems daemon.rb will sometimes prematurely exit. It was this premature exit that caused SetTheServiceStatus.call(SERVICE_STOPPED, NO_ERROR, 0, 0) to never be called, which never signaled the SCM that it can return from StartServiceCtrlDispatcher. Effectively this blocks the call infinitely and deadlocks the process.

Related PRs:
chef/win32-service#21
puppetlabs/puppet-win32-ruby#51
puppetlabs/puppet-win32-ruby#52

(PUP-2987) Windows service runinterval parsing
 - Refactor parsing code to a separate method to cleanup run loop
@puppetcla

This comment has been minimized.

Copy link

commented Aug 4, 2014

CLA signed by all contributors.

(PUP-2987) Restructure Windows service code
 - Move runinterval parsing and execution of the puppet agent to a new
   thread that maintains a busyloop until either:
    - the service is no longer running
    - an exception has occurred with parsing the runinterval
 - Rather than performing a wakeup against the main thread, simply kill
   this new thread on service_stop
 - Main service code will wait until the busyloop thread dies, then will
   exit
 - Note that this change is ultimately not responsible for the service
   hangs experienced in the service.  Additional changes have been made
   to the win32-service gem to ensure events being waited on with
   WaitForSingleObject are always signaled properly, even in failure
   cases.  Please see merged PR for more info:
   chef/win32-service#21
   puppetlabs/puppet-win32-ruby#51

@Iristyle Iristyle changed the title (PUP-2987) Windows service hangs WIP (PUP-2987) Windows service hangs Aug 20, 2014

joshcooper added a commit that referenced this pull request Aug 20, 2014

Merge pull request #2936 from Iristyle/ticket/master/PUP-2987-windows…
…-service-hangs

(PUP-2987) Windows service hangs

@joshcooper joshcooper merged commit 2c8dfc3 into puppetlabs:master Aug 20, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@Iristyle Iristyle deleted the Iristyle:ticket/master/PUP-2987-windows-service-hangs branch Mar 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.