Permalink
Browse files

reset connection after messing up (some kind of internal state).

  • Loading branch information...
Robey Pointer
Robey Pointer committed Dec 14, 2010
1 parent 50c1164 commit d6991c9f92ad1a1728ff28d8f72888de64cd4dff
Showing with 6 additions and 0 deletions.
  1. +2 −0 lib/gizzard/commands.rb
  2. +4 −0 lib/vendor/thrift_client/simple.rb
View
@@ -772,6 +772,7 @@ def reload(app_servers)
end
end
print "\n"
+ service.reset
end
def do_burst(app_servers, shard_ids)
@@ -810,6 +811,7 @@ def do_burst(app_servers, shard_ids)
reload(app_servers)
print "Starting copies "
+ STDOUT.flush
busy_count = service.get_busy_shards().size
i = 0
to_copy.each do |from_shard_id, to_shard_id|
@@ -317,6 +317,10 @@ def self.thrift_method(name, rtype, *args)
class_eval "def #{name}(#{arg_names}); _proxy(:#{name}#{args.size > 0 ? ', ' : ''}#{arg_names}); end"
end
+ def reset
+ @connection = nil
+ end
+
def connection
@connection ||= TCPSocket.new(@host, @port)
end

0 comments on commit d6991c9

Please sign in to comment.