-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set defaults and expose configuration of tchannel timeouts. #2173
Changes from 1 commit
3b46c82
88aee00
df955f1
faa9b18
a4abffe
6163b58
b4301cd
fab5ce2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,8 +158,8 @@ type DBConfiguration struct { | |
// of applying back-pressure or protecting the db nodes. | ||
Limits Limits `yaml:"limits"` | ||
|
||
// Tchannel exposes tchannel config options. | ||
Tchannel TchannelConfiguration `yaml:"tchannel"` | ||
// TChannel exposes tchannel config options. | ||
TChannel *TChannelConfiguration `yaml:"tchannel"` | ||
} | ||
|
||
// InitDefaultsAndValidate initializes all default values and validates the Configuration. | ||
|
@@ -577,8 +577,8 @@ func IsSeedNode(initialCluster []environment.SeedNode, hostID string) bool { | |
return false | ||
} | ||
|
||
// TchannelConfiguration holds tchannel config options. | ||
type TchannelConfiguration struct { | ||
// TChannelConfiguration holds tchannel config options. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: "TChannel" in the comment |
||
type TChannelConfiguration struct { | ||
MaxIdleTime time.Duration `yaml:"maxIdleTime"` | ||
IdleCheckInterval time.Duration `yaml:"idleCheckInterval"` | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,7 +199,7 @@ var ( | |
SetJitter(true), | ||
) | ||
|
||
// defaultChannelOptions are tchannel channel options defaults. | ||
// defaultChannelOptions are default tchannel channel options. | ||
defaultChannelOptions = &tchannel.ChannelOptions{ | ||
MaxIdleTime: 5 * time.Minute, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Probably would've opted for 1min max idle time and 1-2 minute idle check interval, just since 1min in this world is a very long time heh. |
||
IdleCheckInterval: 5 * time.Minute, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -600,9 +600,9 @@ func Run(runOpts RunOptions) { | |
// SetDatabase() once we've initialized it. | ||
service = ttnode.NewService(nil, ttopts) | ||
) | ||
if cfg.Tchannel.MaxIdleTime > 0 && cfg.Tchannel.IdleCheckInterval > 0 { | ||
tchannelOpts.MaxIdleTime = cfg.Tchannel.MaxIdleTime | ||
tchannelOpts.IdleCheckInterval = cfg.Tchannel.IdleCheckInterval | ||
if cfg.TChannel != nil { | ||
tchannelOpts.MaxIdleTime = cfg.TChannel.MaxIdleTime | ||
tchannelOpts.IdleCheckInterval = cfg.TChannel.IdleCheckInterval | ||
Comment on lines
+604
to
+605
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do these need to be greater than 0? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are checks in the tchannel code already.
|
||
} | ||
tchannelthriftNodeClose, err := ttnode.NewServer(service, | ||
cfg.ListenAddress, contextPool, tchannelOpts).ListenAndServe() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "TChannel" in the comment