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

config: add config file support. #4509

Merged
merged 12 commits into from Sep 14, 2017

Conversation

Projects
None yet
4 participants
@coocood
Member

coocood commented Sep 12, 2017

Support load configuration from a toml file, and override by arguments.

And refactored main.go.

coocood added some commits Sep 11, 2017

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood
Member

coocood commented Sep 13, 2017

@@ -128,7 +129,7 @@ func (s *Server) newConn(conn net.Conn) *clientConn {
}
func (s *Server) skipAuth() bool {

This comment has been minimized.

@tiancaiamao

tiancaiamao Sep 13, 2017

Contributor

Is this function called anywhere?

@tiancaiamao

tiancaiamao Sep 13, 2017

Contributor

Is this function called anywhere?

This comment has been minimized.

@coocood

coocood Sep 13, 2017

Member

in readOptionalSSLRequestAndHandshakeResponse method

@coocood

coocood Sep 13, 2017

Member

in readOptionalSSLRequestAndHandshakeResponse method

Show outdated Hide outdated tidb-server/main.go Outdated
if *binlogSocket != "" {
createBinlogClient()
}
func registerStores() {

This comment has been minimized.

@tiancaiamao

tiancaiamao Sep 13, 2017

Contributor

I suggest register store in func init(), some tests may not call main() but they need mocktikv.

@tiancaiamao

tiancaiamao Sep 13, 2017

Contributor

I suggest register store in func init(), some tests may not call main() but they need mocktikv.

This comment has been minimized.

@coocood

coocood Sep 13, 2017

Member

init in which package?

@coocood

coocood Sep 13, 2017

Member

init in which package?

runtime.GOMAXPROCS(runtime.NumCPU())
var (
cfg *config.Config

This comment has been minimized.

@tiancaiamao

tiancaiamao Sep 13, 2017

Contributor

This is actually a pointer to gloablConfig?

@tiancaiamao

tiancaiamao Sep 13, 2017

Contributor

This is actually a pointer to gloablConfig?

This comment has been minimized.

@coocood

coocood Sep 13, 2017

Member

Yes.

@coocood

coocood Sep 13, 2017

Member

Yes.

log.Error(err)
}
if cfg.XProtocol.XServer {
if err := xsvr.Run(); err != nil {

This comment has been minimized.

@tiancaiamao

tiancaiamao Sep 13, 2017

Contributor

srv.Run() will not return, so it won't get to xsvr.Run() normally...

@tiancaiamao

tiancaiamao Sep 13, 2017

Contributor

srv.Run() will not return, so it won't get to xsvr.Run() normally...

This comment has been minimized.

@coocood

coocood Sep 13, 2017

Member

Yes, but it's the same as before, we not going to handle this issue in this PR.

@coocood

coocood Sep 13, 2017

Member

Yes, but it's the same as before, we not going to handle this issue in this PR.

This comment has been minimized.

@tiancaiamao
@tiancaiamao

tiancaiamao Sep 13, 2017

Contributor

okay @wentaoxu

This comment has been minimized.

@wentaoxu

wentaoxu Sep 14, 2017

Contributor

thx, @jackysp have fix it, will be merged with branch xwt/x-protocol

@wentaoxu

wentaoxu Sep 14, 2017

Contributor

thx, @jackysp have fix it, will be merged with branch xwt/x-protocol

@tiancaiamao

This comment has been minimized.

Show comment
Hide comment
@tiancaiamao

tiancaiamao Sep 13, 2017

Contributor

LGTM

Contributor

tiancaiamao commented Sep 13, 2017

LGTM

Show outdated Hide outdated config/config_test.go Outdated
Show outdated Hide outdated server/http_status.go Outdated
Show outdated Hide outdated server/server.go Outdated

coocood added some commits Sep 14, 2017

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood
Member

coocood commented Sep 14, 2017

@zimulala PTAL

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 14, 2017

Member

/run-all-test

Member

coocood commented Sep 14, 2017

/run-all-test

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 14, 2017

Member

/run-all-test

Member

coocood commented Sep 14, 2017

/run-all-test

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 14, 2017

Member

/run-all-test

Member

coocood commented Sep 14, 2017

/run-all-test

@zimulala

This comment has been minimized.

Show comment
Hide comment
@zimulala

zimulala Sep 14, 2017

Member

LGTM

Member

zimulala commented Sep 14, 2017

LGTM

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 14, 2017

Member

/run-common-test

Member

coocood commented Sep 14, 2017

/run-common-test

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 14, 2017

Member

/run-integration-common-test

Member

coocood commented Sep 14, 2017

/run-integration-common-test

@coocood coocood merged commit 97242d3 into master Sep 14, 2017

4 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@coocood coocood deleted the coocood/config branch Sep 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment