anchor.diff:                                         {list_to_binary(User),
                                           list_to_binary(Pass)}}),
           S of
  -        Sock -> Sock
  +        Sock -> {ok, Sock}
       catch
           E:R ->
               ?log_warning("Unable to connect: ~p, retrying.", [{E, R}]),
               timer:sleep(1000), % Avoid reconnecting too fast.
  -            connect()
  +            connect(Tries - 1)
       end.
   
   
  
positive.code: %%
  
  connect() ->
      Config = ns_config:get(),
      Port = ns_config:search_node_prop(Config, memcached, port),
      User = ns_config:search_node_prop(Config, memcached, admin_user),
  
negative.code: %%
  
  init(Bucket) ->
      %% this trap_exit is necessary for terminate callback to work
      process_flag(trap_exit, true),
  
      {ok, Timer} = timer:send_interval(?CHECK_WARMUP_INTERVAL, check_started),
      case connect() of
          {ok, Sock} ->
              ensure_bucket(Sock, Bucket),
              gen_event:notify(buckets_events, {started, Bucket}),
              {ok, #state{
                 timer=Timer,
                 status=init,
                 start_time=now(),
                 sock=Sock,
                 bucket=Bucket}};
          {error, _} = Error ->
              Error
      end.
  
  handle_call(Msg, From, State) ->
      StartTS = os:timestamp(),
  