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
[SCB-1301] Abstract control flow from serf/etcd/grpc #556
Conversation
syncer/serf/agent.go
Outdated
serfAgent := a.Agent.Serf() | ||
if serfAgent != nil { | ||
for _, member := range serfAgent.Members() { | ||
fmt.Println("member: ", member.Tags[tagKeyCluster]) |
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.
Change fmt
to log
?
s.waitQuit(ctx) | ||
s.servicecenter.SetStorage(s.etcd.Storage()) | ||
|
||
s.agent.RegisterEventHandler(s) |
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.
This Handler is same with the one in serf/agent.go, but they responsible for different event, I think we should add some comments to them at lease.
@@ -124,3 +163,37 @@ func (a *Agent) UserEvent(name string, payload []byte, coalesce bool) error { | |||
func (a *Agent) Query(name string, payload []byte, params *serf.QueryParam) (*serf.QueryResponse, error) { | |||
return a.Agent.Query(name, payload, params) | |||
} | |||
|
|||
func (a *Agent) retryJoin(ctx context.Context) (err error) { |
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.
Suggest to give some comments here to tell what is retryJoin
's repsonsiblity?
"github.com/apache/servicecomb-service-center/syncer/plugins" | ||
"github.com/apache/servicecomb-service-center/syncer/serf" | ||
"github.com/apache/servicecomb-service-center/syncer/servicecenter" | ||
) | ||
|
||
var stopChanErr = errors.New("stopped syncer by stopCh") | ||
|
||
type moduleServer interface { |
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.
Suggest to give some comments to tell why moduleServer
interface here?
@@ -21,10 +21,11 @@ import ( | |||
"errors" | |||
"testing" | |||
|
|||
"github.com/apache/servicecomb-service-center/syncer/pkg/mock/mocksotrage" | |||
|
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.
blank line, delete?
@ChinX It is LGTM, but I think you can add some comments to the key progress first. Please let me know once you finish the comments. |
Codecov Report
@@ Coverage Diff @@
## master #556 +/- ##
=========================================
- Coverage 58.55% 58.4% -0.15%
=========================================
Files 201 201
Lines 15257 15315 +58
=========================================
+ Hits 8934 8945 +11
- Misses 5701 5750 +49
+ Partials 622 620 -2
Continue to review full report at Codecov.
|
LGTM |
Abstract control flow from serf/etcd/grpc.
Follow this checklist to help us incorporate your contribution quickly and easily:
[SCB-XXX] Fixes bug in ApproximateQuantiles
, where you replaceSCB-XXX
with the appropriate JIRA issue.go build
go test
go fmt
go vet
to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.