-
Notifications
You must be signed in to change notification settings - Fork 454
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3b46c82
Set defaults and expose configuration of tchannel timeouts.
notbdu 88aee00
Imports
notbdu df955f1
Fix test.
notbdu faa9b18
Address PR comments.
notbdu a4abffe
Set idle check interval and max idle time for query m3db client as well.
notbdu 6163b58
Imports.
notbdu b4301cd
Caps.
notbdu fab5ce2
Merge branch 'master' into bdu/tchannel-timeout
notbdu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,7 @@ import ( | |
apachethrift "github.com/apache/thrift/lib/go/thrift" | ||
opentracing "github.com/opentracing/opentracing-go" | ||
"github.com/uber-go/tally" | ||
"github.com/uber/tchannel-go" | ||
"go.etcd.io/etcd/embed" | ||
"go.uber.org/zap" | ||
) | ||
|
@@ -599,6 +600,10 @@ func Run(runOpts RunOptions) { | |
// SetDatabase() once we've initialized it. | ||
service = ttnode.NewService(nil, ttopts) | ||
) | ||
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() | ||
if err != nil { | ||
|
@@ -694,7 +699,7 @@ func Run(runOpts RunOptions) { | |
|
||
origin := topology.NewHost(hostID, "") | ||
m3dbClient, err := newAdminClient( | ||
cfg.Client, iopts, syncCfg.TopologyInitializer, runtimeOptsMgr, | ||
cfg.Client, iopts, tchannelOpts, syncCfg.TopologyInitializer, runtimeOptsMgr, | ||
origin, protoEnabled, schemaRegistry, syncCfg.KVStore, logger) | ||
if err != nil { | ||
logger.Fatal("could not create m3db client", zap.Error(err)) | ||
|
@@ -729,7 +734,7 @@ func Run(runOpts RunOptions) { | |
// Guaranteed to not be nil if repair is enabled by config validation. | ||
clientCfg := *cluster.Client | ||
clusterClient, err := newAdminClient( | ||
clientCfg, iopts, topologyInitializer, runtimeOptsMgr, | ||
clientCfg, iopts, tchannelOpts, topologyInitializer, runtimeOptsMgr, | ||
origin, protoEnabled, schemaRegistry, syncCfg.KVStore, logger) | ||
if err != nil { | ||
logger.Fatal( | ||
|
@@ -1544,6 +1549,7 @@ func withEncodingAndPoolingOptions( | |
func newAdminClient( | ||
config client.Configuration, | ||
iopts instrument.Options, | ||
tchannelOpts *tchannel.ChannelOptions, | ||
topologyInitializer topology.Initializer, | ||
runtimeOptsMgr m3dbruntime.OptionsManager, | ||
origin topology.Host, | ||
|
@@ -1564,6 +1570,9 @@ func newAdminClient( | |
SetMetricsScope(iopts.MetricsScope().SubScope("m3dbclient")), | ||
TopologyInitializer: topologyInitializer, | ||
}, | ||
func(opts client.AdminOptions) client.AdminOptions { | ||
return opts.SetChannelOptions(tchannelOpts).(client.AdminOptions) | ||
}, | ||
func(opts client.AdminOptions) client.AdminOptions { | ||
return opts.SetRuntimeOptionsManager(runtimeOptsMgr).(client.AdminOptions) | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: 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.