From 0fd8c98301398a3394ff0a375413928661d10276 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sun, 11 Sep 2016 16:08:34 -0400 Subject: [PATCH 1/2] test starting tendermint before app --- test/app/test.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/app/test.sh b/test/app/test.sh index ce9fff8df..d44ad2f25 100644 --- a/test/app/test.sh +++ b/test/app/test.sh @@ -26,6 +26,24 @@ function dummy_over_socket(){ kill -9 $pid_dummy $pid_tendermint } +# start tendermint first +function dummy_over_socket_reorder(){ + rm -rf $TMROOT + tendermint init + echo "Starting tendermint and dummy" + tendermint node > tendermint.log & + pid_tendermint=$! + sleep 2 + dummy > /dev/null & + pid_dummy=$! + sleep 5 + + echo "running test" + bash dummy_test.sh "Dummy over Socket" + + kill -9 $pid_dummy $pid_tendermint +} + function counter_over_socket() { rm -rf $TMROOT @@ -65,6 +83,9 @@ case "$1" in "dummy_over_socket") dummy_over_socket ;; + "dummy_over_socket_reorder") + dummy_over_socket_reorder + ;; "counter_over_socket") counter_over_socket ;; @@ -75,6 +96,8 @@ case "$1" in echo "Running all" dummy_over_socket echo "" + dummy_over_socket_reorder + echo "" counter_over_socket echo "" counter_over_grpc From c7e578ac0d17d76bdf6a05ae4a1c46106d055fba Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sun, 11 Sep 2016 16:02:29 -0400 Subject: [PATCH 2/2] check tmsp client err and set mustConnect=false --- node/node.go | 3 +++ proxy/client.go | 3 +-- proxy/multi_app_conn.go | 3 ++- version/version.go | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/node/node.go b/node/node.go index 72e08b8b8..e8099c7f4 100644 --- a/node/node.go +++ b/node/node.go @@ -68,6 +68,9 @@ func NewNode(config cfg.Config, privValidator *types.PrivValidator, clientCreato // Create the proxyApp, which houses three connections: // query, consensus, and mempool proxyApp := proxy.NewAppConns(config, clientCreator, state, blockStore) + if _, err := proxyApp.Start(); err != nil { + Exit(Fmt("Error starting proxy app connections: %v", err)) + } // add the chainid and number of validators to the global config config.Set("chain_id", state.ChainID) diff --git a/proxy/client.go b/proxy/client.go index ea3218d32..c6e03e787 100644 --- a/proxy/client.go +++ b/proxy/client.go @@ -54,7 +54,6 @@ func NewRemoteClientCreator(addr, transport string, mustConnect bool) ClientCrea func (r *remoteClientCreator) NewTMSPClient() (tmspcli.Client, error) { // Run forever in a loop - fmt.Println("ADDR", r.addr, r.transport) remoteApp, err := tmspcli.NewClient(r.addr, r.transport, r.mustConnect) if err != nil { return nil, fmt.Errorf("Failed to connect to proxy: %v", err) @@ -75,7 +74,7 @@ func DefaultClientCreator(config cfg.Config) ClientCreator { case "nilapp": return NewLocalClientCreator(nilapp.NewNilApplication()) default: - mustConnect := true + mustConnect := false // loop retrying return NewRemoteClientCreator(addr, transport, mustConnect) } } diff --git a/proxy/multi_app_conn.go b/proxy/multi_app_conn.go index fe009e1d6..9ff388624 100644 --- a/proxy/multi_app_conn.go +++ b/proxy/multi_app_conn.go @@ -7,6 +7,8 @@ import ( // Tendermint's interface to the application consists of multiple connections type AppConns interface { + Service + Mempool() AppConnMempool Consensus() AppConnConsensus Query() AppConnQuery @@ -42,7 +44,6 @@ func NewMultiAppConn(config cfg.Config, clientCreator ClientCreator, state State clientCreator: clientCreator, } multiAppConn.QuitService = *NewQuitService(log, "multiAppConn", multiAppConn) - multiAppConn.Start() return multiAppConn } diff --git a/version/version.go b/version/version.go index 5dc83a23d..104353142 100644 --- a/version/version.go +++ b/version/version.go @@ -2,6 +2,6 @@ package version const Maj = "0" const Min = "7" // tmsp useability (protobuf, unix); optimizations; broadcast_tx_commit -const Fix = "1" // query conn, peer filter, fast sync fix +const Fix = "2" // query conn, peer filter, fast sync fix (+hot fix to tmsp connecting) const Version = Maj + "." + Min + "." + Fix