Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

config: check and correct format of addr and URL #937

Merged
merged 7 commits into from
Aug 28, 2020

Conversation

lance6716
Copy link
Collaborator

What problem does this PR solve?

check and correct format of addr and URL in config files

What is changed and how it works?

for xxx-addr, it should not have a scheme. for xxx-urls and its parent config, such as join, initial-cluster, element in it should have a scheme

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • Has exported function/method change

Side effects

Related changes

@lance6716 lance6716 added needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 status/PTAL This PR is ready for review. Add this label back after committing new changes priority/normal Minor change, requires approval from ≥1 primary reviewer type/bug-fix Bug fix labels Aug 27, 2020
@lance6716 lance6716 added the needs-update-docs Should update docs after this PR is merged. Remove this label once the docs are updated label Aug 27, 2020
@csuzhangxc
Copy link
Member

CI failed

@lance6716
Copy link
Collaborator Author

CI failed

will check testMaster.TestServer soon

dm/master/config.go Outdated Show resolved Hide resolved
Copy link
Member

@csuzhangxc csuzhangxc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

dm/worker/join.go Show resolved Hide resolved
@csuzhangxc csuzhangxc added this to the v2.0.0 RC.2 milestone Aug 28, 2020
@csuzhangxc csuzhangxc added status/LGT1 One reviewer already commented LGTM and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Aug 28, 2020
@csuzhangxc csuzhangxc requested a review from GMHDBJD August 28, 2020 09:28
@lance6716
Copy link
Collaborator Author

lance6716 commented Aug 28, 2020

seems gRPC (at lease our specified version) should remove http://, otherwise it can't connect

package main

import (
	"context"
	"log"
	"net"
	"time"

	"google.golang.org/grpc"
)

func main() {
	go func() {
		port := "127.0.0.1:8261"
		lis, err := net.Listen("tcp", port)
		if err != nil {
			log.Fatalf("failed to listen: %v", err)
		}
		s := grpc.NewServer()

		if err := s.Serve(lis); err != nil {
			log.Fatalf("failed to serve: %v", err)
		}
	}()

	time.Sleep(time.Second)
	ctx1, cancel1 := context.WithTimeout(context.Background(), 3*time.Second)
	conn, err := grpc.DialContext(ctx1, "http://127.0.0.1:8261", grpc.WithInsecure(), grpc.WithBlock(), grpc.WithBackoffMaxDelay(3*time.Second))
	if err != nil {
		log.Fatalf("did not connect: %v", err)
	}
	defer conn.Close()
	cancel1()
}

Copy link
Collaborator

@GMHDBJD GMHDBJD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GMHDBJD GMHDBJD added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels Aug 28, 2020
@lance6716 lance6716 merged commit 92b3e58 into pingcap:master Aug 28, 2020
@ti-srebot
Copy link

cherry pick to release-2.0 in PR #955

@ti-srebot ti-srebot added already-cherry-pick-2.0 The related PR is already cherry-picked to release-2.0. Add this label once the PR is cherry-picked and removed needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 labels Aug 28, 2020
csuzhangxc pushed a commit that referenced this pull request Aug 28, 2020
Co-authored-by: lance6716 <lance6716@gmail.com>
@csuzhangxc csuzhangxc added already-update-docs The docs related to this PR already updated. Add this label once the docs are updated and removed needs-update-docs Should update docs after this PR is merged. Remove this label once the docs are updated labels Aug 31, 2020
@lance6716 lance6716 deleted the addr-url branch July 6, 2021 02:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
already-cherry-pick-2.0 The related PR is already cherry-picked to release-2.0. Add this label once the PR is cherry-picked already-update-docs The docs related to this PR already updated. Add this label once the docs are updated priority/normal Minor change, requires approval from ≥1 primary reviewer status/LGT2 Two reviewers already commented LGTM, ready for merge type/bug-fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants