try remove cmux
This commit is contained in:
1 parent
ef4dc0e972
commit
284a9bb444
4 files changed
+26
-24
No files matched your search
Generated
+3
-12
@@ -296,7 +296,7 @@
|
||||
version = "v2.0.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:128d52b9a5403f1317ca63303eba69d540e4e4ec23fbd3f4961d29b46583dcc5"
|
||||
digest = "1:1562269205ab0c6685c8b0b99511e91b9d3627e4cac3f0288378bc8930e658f1"
|
||||
name = "github.com/integration-system/isp-lib-test"
|
||||
packages = [
|
||||
"ctx",
|
||||
@@ -305,8 +305,8 @@
|
||||
"utils/postgres",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "6fa261f607e7948466ebdcac2dad9283705e265f"
|
||||
version = "v1.4.0"
|
||||
revision = "6da4f1fed4b0df648a9b1c4bd4098fdd405695e1"
|
||||
version = "v1.4.1"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
@@ -482,14 +482,6 @@
|
||||
revision = "839c75faf7f98a33d445d181f3018b5c3409a45e"
|
||||
version = "v1.4.2"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:30e06e6d62a1d694e3cdbff29d8a9a96022e05a487d0c6eaf0ef898965ef28fb"
|
||||
name = "github.com/soheilhy/cmux"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "e09e9389d85d8492d313d73d1469c029e710623f"
|
||||
version = "v0.1.4"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:bb495ec276ab82d3dd08504bbc0594a65de8c3b22c6f2aaa92d05b73fbf3a82e"
|
||||
name = "github.com/spf13/afero"
|
||||
@@ -777,7 +769,6 @@
|
||||
"github.com/pkg/errors",
|
||||
"github.com/satori/go.uuid",
|
||||
"github.com/sirupsen/logrus",
|
||||
"github.com/soheilhy/cmux",
|
||||
"github.com/spf13/cast",
|
||||
"github.com/stretchr/testify/assert",
|
||||
"github.com/thecodeteam/goodbye",
|
||||
|
||||
@@ -95,6 +95,9 @@ func getUrl(address string) string {
|
||||
}
|
||||
cfg := config.Get().(*conf.Configuration)
|
||||
|
||||
// REMOVE
|
||||
addr.Port = addr.Port + 5
|
||||
|
||||
params := url.Values{}
|
||||
params.Add(ClusterParam, "true")
|
||||
// TODO выпилить instance_uuid ?
|
||||
|
||||
@@ -96,7 +96,9 @@ func setup(testCtx *ctx.TestContext, runTest func() int) int {
|
||||
},
|
||||
}
|
||||
configsGrpcAddrs[i] = grpcAddr
|
||||
configsHttpAddrs[i] = httpAddr
|
||||
//configsHttpAddrs[i] = httpAddr
|
||||
// REMOVE
|
||||
configsHttpAddrs[i] = getConfigServiceAddress(i, "9006")
|
||||
configs[i] = cfg
|
||||
peersAddrs[i] = httpAddr.GetAddress()
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"github.com/integration-system/isp-lib/structure"
|
||||
"github.com/integration-system/isp-lib/utils"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"github.com/soheilhy/cmux"
|
||||
"github.com/thecodeteam/goodbye"
|
||||
"isp-config-service/cluster"
|
||||
"isp-config-service/codes"
|
||||
@@ -27,7 +26,6 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -103,16 +101,24 @@ func initMultiplexer(addressConfiguration structure.AddressConfiguration) (net.L
|
||||
return nil, nil, fmt.Errorf("create tcp transport: %v", err)
|
||||
}
|
||||
|
||||
m := cmux.New(tcpListener)
|
||||
httpListener := m.Match(cmux.HTTP1Fast())
|
||||
raftListener := m.Match(cmux.Any())
|
||||
// REMOVE
|
||||
outerAddr.Port = outerAddr.Port + 5
|
||||
httpListener, err := net.ListenTCP("tcp4", outerAddr)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("create tcp transport: %v", err)
|
||||
}
|
||||
return httpListener, tcpListener, nil
|
||||
|
||||
go func() {
|
||||
if err := m.Serve(); err != nil && !strings.Contains(err.Error(), "use of closed network connection") {
|
||||
log.Fatalf(codes.InitCmuxError, "serve cmux: %v", err)
|
||||
}
|
||||
}()
|
||||
return httpListener, raftListener, nil
|
||||
//m := cmux.New(tcpListener)
|
||||
//httpListener := m.Match(cmux.HTTP1Fast())
|
||||
//raftListener := m.Match(cmux.Any())
|
||||
//
|
||||
//go func() {
|
||||
// if err := m.Serve(); err != nil && !strings.Contains(err.Error(), "use of closed network connection") {
|
||||
// log.Fatalf(codes.InitCmuxError, "serve cmux: %v", err)
|
||||
// }
|
||||
//}()
|
||||
//return httpListener, raftListener, nil
|
||||
}
|
||||
|
||||
func initWebsocket(ctx context.Context, listener net.Listener, raftStore *store.Store) {
|
||||
|
||||
Reference in new issue
Block a user