Chef

Search queries return empty results occationally

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 0.5.2
  • Fix Version/s: 0.5.4
  • Component/s: Chef Client
  • Labels:
    None

Description

When running chef-client, my search queries for other nodes will sometimes return no results. I believe I tracked this down to Chef::Rest.run_request.

It seems the call to read_body without a block on line 151 may be creating some sort of race condition that causes the call to resp.body to return a blank string. After removing this call to read_body, or putting a sleep after it, I was not able to reproduce the problem.

I am running ruby 1.8.7 on Ubuntu.

Thanks,
Kris

Activity

Hide
Adam Jacob added a comment - 03/Feb/09 1:36 AM

Thanks for the great bug report, Kris. We'll get this fixed in the next release.

Show
Adam Jacob added a comment - 03/Feb/09 1:36 AM Thanks for the great bug report, Kris. We'll get this fixed in the next release.
Hide
Kris Rasmussen added a comment - 03/Feb/09 1:52 AM

It looks like I spoke to soon, I've hit the same problem with the read_body call removed. However, I'm still unable to reproduce if I sleep for a little bit between the initial request and the call to get the body.

Show
Kris Rasmussen added a comment - 03/Feb/09 1:52 AM It looks like I spoke to soon, I've hit the same problem with the read_body call removed. However, I'm still unable to reproduce if I sleep for a little bit between the initial request and the call to get the body.
Hide
Adam Jacob added a comment - 04/Feb/09 12:02 AM

Kris, are you seeing this behavior with the latest Chef, and is it inconsistent on the same call to search?

There was a bug with doing search(:node, "*") that was fixed very recently - and I'm curious if this is the cause of the issue you have been seeing.

If it is not, can you supply us with a recipe snippet that causes this behavior to happen sometimes?

Show
Adam Jacob added a comment - 04/Feb/09 12:02 AM Kris, are you seeing this behavior with the latest Chef, and is it inconsistent on the same call to search? There was a bug with doing search(:node, "*") that was fixed very recently - and I'm curious if this is the cause of the issue you have been seeing. If it is not, can you supply us with a recipe snippet that causes this behavior to happen sometimes?
Hide
Kris Rasmussen added a comment - 10/Feb/09 7:30 AM

Hi Adam,

I installed 0.5.2 and have not been able to reproduce the problem since.

Thanks!
Kris

Show
Kris Rasmussen added a comment - 10/Feb/09 7:30 AM Hi Adam, I installed 0.5.2 and have not been able to reproduce the problem since. Thanks! Kris
Hide
Adam Jacob added a comment - 12/Feb/09 5:05 PM

This was fixed in 0.5.2.

Show
Adam Jacob added a comment - 12/Feb/09 5:05 PM This was fixed in 0.5.2.

People

Vote (0)
Watch (0)

Dates

  • Created:
    02/Feb/09 7:50 AM
    Updated:
    12/Feb/09 5:05 PM
    Resolved:
    12/Feb/09 5:05 PM