[chef-dev] Re: Re: Re: [chef] Re: Re: Intermittent chef-expander problem


Chronological Thread 
  • From: Alex Kiernan < >
  • To:
  • Subject: [chef-dev] Re: Re: Re: [chef] Re: Re: Intermittent chef-expander problem
  • Date: Mon, 5 Sep 2011 10:11:29 +0100

On Fri, Sep 2, 2011 at 7:52 PM, Alex Kiernan 
< >
 wrote:
> On Fri, Sep 2, 2011 at 5:23 PM, Daniel DeLeo 
> < >
>  wrote:
>>>
>>> Had a look last night... I can't for the life of me figure out what
>>> the code path is which makes it exit when it gets invalid JSON as it
>>> looks like it's designed to cope :|
>>>
>> Everything still working?
>>
>
> It is. I didn't want to jinx it by declaring success too soon, but if
> we get through the weekend I think we can say it's fixed.
>

Died over the weekend, same symptoms, though something (probably chef)
has put it back to my pre-hacked state.

>> Also, do you still have a stack trace from when expander was crashing?
>
> I don't :( Once it's clear it's fixed I'll swap the old json back in
> and get a new one.
>

Just realised I was looking at chef-client stackstraces when I had
them not expander - does expander drop them anywhere I'm missing?

>> Looks like we might need to explicitly return nil here:
>https://github.com/opscode/chef/blob/master/chef-expander/lib/chef/expander/solrizer.rb#L110
>>
>
> /me slaps head
>
> yes - that makes perfect sense of the failure we were seeing... I'll
> make that change and swap back to the old json after the weekend and
> see if that fixes it up.
>

With it broken this morning I left rabbitmq running and added in that
nil to chef-expander, it resolves the problem, you get the two log
messages you'd exect and the message gets discarded:

diff --git a/chef-expander/lib/chef/expander/solrizer.rb
b/chef-expander/lib/chef/expander/solrizer.rb
index 1a6fed9..350d0ba 100644
--- a/chef-expander/lib/chef/expander/solrizer.rb
+++ b/chef-expander/lib/chef/expander/solrizer.rb
@@ -108,6 +108,7 @@ module Chef
         Yajl::Parser.parse(serialized_object)
       rescue Yajl::ParseError
         log.error { "cannot index object because it is invalid JSON:
#{serialized_object}" }
+        nil
       end

       def run

I'll throw in a ticket later.

-- 
Alex Kiernan



Archive powered by MHonArc 2.6.16.

§