berkshelf / ridley

A reliable Chef API client with a clean syntax
Other
231 stars 85 forks source link

Increase timeout for search, partial_search. #373

Open olebel opened 7 years ago

olebel commented 7 years ago

I'm using Ridley to partial_search on several Chef servers for nodes with limited set of attributes. Like that:

  chef_server = Ridley.new(
      server_url: cs['url'],
      client_name: cs['client_name'],
      client_key: cs['client_key'],
      ssl: { verify: cs['ssl_verify'] }
    )

    nodes = chef_server.partial_search(:node, search_query, attributes)

For Chef servers with ~1000 nodes onboard recently i start getting timeout errors. This happens if search time exceeds 1 minute:

==> master: [2017-06-16T13:45:30+00:00] INFO: Searching on external chef-server url: https://chef-server.example.com:443
==> master: E, [2017-06-16T13:46:30.874093 #17757] ERROR -- : Actor crashed!
==> master: Ridley::Errors::TimeoutError: execution expired

It looks like i hit some threshold as result of combination of amount of nodes/attributes set/Chef server performance.

Any way to increase default 60s timeout?