Skip to content

Commit 3f1463d

Browse files
committed
Update
1 parent 4a04cfb commit 3f1463d

File tree

7 files changed

+22
-52
lines changed

7 files changed

+22
-52
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ bazel-testlogs
2828

2929
# Java files
3030
*.exe
31+
32+
# Logs files
33+
*.ERROR*
34+
*.INFO*
35+
*.WARNING*

cmd/skytest/BUILD.bazel

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ go_binary(
3535
],
3636
)
3737

38-
pkg_tar(
39-
name = "binary",
40-
srcs = [
41-
":skytest-client",
42-
":skytest-server",
43-
],
44-
package_dir = "/skylb",
45-
)
38+
# pkg_tar(
39+
# name = "binary",
40+
# srcs = [
41+
# ":skytest-client",
42+
# ":skytest-server",
43+
# ],
44+
# package_dir = "/skylb",
45+
# )
4646

4747
# docker_build(
4848
# name = "latest",

cmd/skytest/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ skylb-apiv2/bazel-bin/cmd/skytest/skytest-server_/skytest-server -port=18002 -al
4646
1. 直连
4747

4848
```shell
49-
skylb-apiv2/bazel-bin/cmd/skytest/skytest-server_/skytest-client -debug-svc-endpoint=shared-test-server-service=localhost:18000,localhost:18001,localhost:18002 -alsologtostderr
49+
skylb-apiv2/bazel-bin/cmd/skytest/skytest-client_/skytest-client -debug-svc-endpoint=shared-test-server-service=localhost:18000,localhost:18001,localhost:18002 -alsologtostderr
5050
```
5151

5252
2. 连skylb
5353

5454
```shell
55-
skylb-apiv2/bazel-bin/cmd/skytest/skytest-server_/skytest-client -skylb-endpoints="127.0.0.1:1900" -v=2 -log_dir=.
55+
skylb-apiv2/bazel-bin/cmd/skytest/skytest-client_/skytest-client -skylb-endpoints="127.0.0.1:1900" -alsologtostderr -v=2 -log_dir=.
5656
```
5757

5858

go.mod

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,6 @@ require (
1818
google.golang.org/protobuf v1.27.1
1919
)
2020

21-
require (
22-
github.com/VividCortex/gohistogram v1.0.0 // indirect
23-
github.com/beorn7/perks v1.0.1 // indirect
24-
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
25-
github.com/cespare/xxhash/v2 v2.1.1 // indirect
26-
github.com/davecgh/go-spew v1.1.1 // indirect
27-
github.com/go-kit/kit v0.10.0 // indirect
28-
github.com/golang/protobuf v1.5.2 // indirect
29-
github.com/google/uuid v1.1.2 // indirect
30-
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
31-
github.com/jtolds/gls v4.20.0+incompatible // indirect
32-
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
33-
github.com/opentracing/opentracing-go v1.2.0 // indirect
34-
github.com/pborman/uuid v1.2.0 // indirect
35-
github.com/pkg/errors v0.9.1 // indirect
36-
github.com/pmezard/go-difflib v1.0.0 // indirect
37-
github.com/prometheus/client_model v0.2.0 // indirect
38-
github.com/prometheus/common v0.10.0 // indirect
39-
github.com/prometheus/procfs v0.1.3 // indirect
40-
github.com/smartystreets/assertions v1.0.1 // indirect
41-
github.com/stretchr/objx v0.2.0 // indirect
42-
github.com/uber/jaeger-client-go v2.24.0+incompatible // indirect
43-
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
44-
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
45-
golang.org/x/text v0.3.7 // indirect
46-
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
47-
)
48-
4921
require (
5022
github.com/google/go-cmp v0.5.7 // indirect
5123
github.com/smartystreets/goconvey v1.6.4

internal/skylb/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ func (sc *serviceClient) Resolve(spec *pb.ServiceSpec, opts ...grpc.DialOption)
5454
dopts = append(dopts, opt)
5555
}
5656
sc.dopts[spec.String()] = dopts
57+
5758
sc.resolve(spec)
5859
}
5960

6061
func (sc *serviceClient) resolve(spec *pb.ServiceSpec) {
6162
if ep, ok := sc.debugSvcEndpoints[spec.ServiceName]; ok {
6263
// Debug mode, do not need to register service.
63-
6464
addrs := strings.Split(ep, ",")
6565
// Check valid addrs
6666
for _, addr := range addrs {

internal/skylb/keeper.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ func (sk *skyLbKeeper) Start(csId vexpb.ServiceId, csName string, resolveFullEps
8686
svcKeeperGauge.Inc()
8787

8888
glog.V(4).Infof("Starting SkyLB keeper for caller service ID %#v", csId)
89-
if len(sk.resolverCliConns) == 0 {
89+
fmt.Printf("len(sk.services): %d\n", len(sk.services))
90+
if len(sk.services) == 0 {
9091
svcKeeperGauge.Dec()
9192
return
9293
}
@@ -124,7 +125,6 @@ func (sk *skyLbKeeper) Start(csId vexpb.ServiceId, csName string, resolveFullEps
124125
func (sk *skyLbKeeper) start(ctx context.Context, req *pb.ResolveRequest) error {
125126
ctxt, cancel := context.WithCancel(ctx)
126127
skyCli, err := rpccli.NewGrpcClient(ctxt)
127-
fmt.Printf("skyCli: %+v \n", skyCli)
128128
if err != nil {
129129
glog.Errorf("Failed to create gRPC client to SkyLB, %+v, retry.", err)
130130
return err
@@ -269,6 +269,10 @@ func (sk *skyLbKeeper) WaitUntilReady() {
269269
<-sk.readyCh
270270
}
271271

272+
func calcServiceKey(spec *pb.ServiceSpec) string {
273+
return fmt.Sprintf("%s.%s:%s", spec.Namespace, spec.ServiceName, spec.PortName)
274+
}
275+
272276
// NewSkyLbKeeper returns a new skylb keeper.
273277
func NewSkyLbKeeper() *skyLbKeeper {
274278
return &skyLbKeeper{

internal/skylb/util.go

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)