gorpc: Change ssl timeout to be different from normal

The different error message will help trouble shoot the root
cause of problems better.
Also, fixed some typos.
This commit is contained in:
Sugu Sougoumarane 2014-04-06 21:59:38 -07:00
Родитель 332b0e9da1
Коммит 14050b920f
2 изменённых файлов: 2 добавлений и 5 удалений

Просмотреть файл

@ -35,9 +35,8 @@ func init() {
flag.Float64Var(&qsConfig.QueryTimeout, "queryserver-config-query-timeout", DefaultQsConfig.QueryTimeout, "query server query timeout") flag.Float64Var(&qsConfig.QueryTimeout, "queryserver-config-query-timeout", DefaultQsConfig.QueryTimeout, "query server query timeout")
flag.Float64Var(&qsConfig.IdleTimeout, "queryserver-config-idle-timeout", DefaultQsConfig.IdleTimeout, "query server idle timeout") flag.Float64Var(&qsConfig.IdleTimeout, "queryserver-config-idle-timeout", DefaultQsConfig.IdleTimeout, "query server idle timeout")
flag.Float64Var(&qsConfig.SpotCheckRatio, "queryserver-config-spot-check-ratio", DefaultQsConfig.SpotCheckRatio, "query server rowcache spot check frequency") flag.Float64Var(&qsConfig.SpotCheckRatio, "queryserver-config-spot-check-ratio", DefaultQsConfig.SpotCheckRatio, "query server rowcache spot check frequency")
flag.Float64Var(&qsConfig.StreamWaitTimeout, "queryserver-config-stream-exec-timeout", DefaultQsConfig.StreamWaitTimeout, "Timeout for stream-exec-throttle")
flag.BoolVar(&qsConfig.SensitiveMode, "queryserver-config-sensitive-mode", DefaultQsConfig.SensitiveMode, "enabling sensitive mode anonymizes queries when displaying diagnostics") flag.BoolVar(&qsConfig.SensitiveMode, "queryserver-config-sensitive-mode", DefaultQsConfig.SensitiveMode, "enabling sensitive mode anonymizes queries when displaying diagnostics")
flag.BoolVar(&qsConfig.StrictMode, "queryserver-config-strict-mode", DefaultQsConfig.StrictMode, "stict mode allows all DMLs and does not enforce MySQL's STRICT_TRANS_TABLES") flag.BoolVar(&qsConfig.StrictMode, "queryserver-config-strict-mode", DefaultQsConfig.StrictMode, "strict mode allows all DMLs and does not enforce MySQL's STRICT_TRANS_TABLES")
flag.StringVar(&qsConfig.RowCache.Binary, "rowcache-bin", DefaultQsConfig.RowCache.Binary, "rowcache binary file") flag.StringVar(&qsConfig.RowCache.Binary, "rowcache-bin", DefaultQsConfig.RowCache.Binary, "rowcache binary file")
flag.IntVar(&qsConfig.RowCache.Memory, "rowcache-memory", DefaultQsConfig.RowCache.Memory, "rowcache max memory usage in MB") flag.IntVar(&qsConfig.RowCache.Memory, "rowcache-memory", DefaultQsConfig.RowCache.Memory, "rowcache max memory usage in MB")
flag.StringVar(&qsConfig.RowCache.Socket, "rowcache-socket", DefaultQsConfig.RowCache.Socket, "rowcache socket path to listen on") flag.StringVar(&qsConfig.RowCache.Socket, "rowcache-socket", DefaultQsConfig.RowCache.Socket, "rowcache socket path to listen on")
@ -98,7 +97,6 @@ type Config struct {
IdleTimeout float64 IdleTimeout float64
RowCache RowCacheConfig RowCache RowCacheConfig
SpotCheckRatio float64 SpotCheckRatio float64
StreamWaitTimeout float64
SensitiveMode bool SensitiveMode bool
StrictMode bool StrictMode bool
} }
@ -124,7 +122,6 @@ var DefaultQsConfig = Config{
StreamBufferSize: 32 * 1024, StreamBufferSize: 32 * 1024,
RowCache: RowCacheConfig{Memory: -1, TcpPort: -1, Connections: -1, Threads: -1}, RowCache: RowCacheConfig{Memory: -1, TcpPort: -1, Connections: -1, Threads: -1},
SpotCheckRatio: 0, SpotCheckRatio: 0,
StreamWaitTimeout: 4 * 60,
SensitiveMode: false, SensitiveMode: false,
StrictMode: true, StrictMode: true,
} }

Просмотреть файл

@ -186,7 +186,7 @@ class GoRpcClient(object):
except ssl.SSLError as e: except ssl.SSLError as e:
# another possible timeout condition with SSL wrapper # another possible timeout condition with SSL wrapper
if 'timed out' in str(e): if 'timed out' in str(e):
raise TimeoutError(e, self.timeout, 'dial', self.uri) raise TimeoutError(e, self.timeout, 'ssl-dial', self.uri)
raise GoRpcError(e) raise GoRpcError(e)
except socket.error as e: except socket.error as e:
raise GoRpcError(e) raise GoRpcError(e)