On Thu, Dec 17, 2009 at 3:44 AM, David Schmitt <[email protected]> wrote:
> On 15.12.2009 01:53, Jesse Wolfe wrote:
>> Make sure that we don't try to do anything to webrick until it has
>> really started.
>>
>> Signed-off-by: Jesse Wolfe<[email protected]>
>> ---
>> lib/puppet/network/http/webrick.rb | 3 ++-
>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/lib/puppet/network/http/webrick.rb
>> b/lib/puppet/network/http/webrick.rb
>> index bf4bf88..cea7631 100644
>> --- a/lib/puppet/network/http/webrick.rb
>> +++ b/lib/puppet/network/http/webrick.rb
>> @@ -44,7 +44,8 @@ class Puppet::Network::HTTP::WEBrick
>> sock.accept
>> @server.run(sock)
>> }
>> - }
>> + }
>> + sleep 0.1 until @server.status == :Running
>
>
> Is this a possible infinite loop if webrick dies?
>
It shouldn't be an _additional_ infinite loop, and the whole thing is
wrapped in timeout {} blocks.
As I first started this response I thought it might make sense to have
a timeout here, something like:
t = 0
until @server.status == :Running
raise "Webrick has hung" if t > 5
t += 0.1
sleep 0.1
end
...so that we'd get a clearer indication of what's happening (a more
specific error) but as I think about it I'm not sure how helpful that
would really be.
-- Markus
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.