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

Commit

Permalink
*: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
csuzhangxc committed Jan 13, 2020
1 parent 21275fb commit 2024c7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dm/worker/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ func (c *Config) adjust() error {
}

if c.AdvertiseAddr == "" {
if host == "" {
return terror.ErrWorkerHostPortNotValid.Generatef("worker-addr (%s) must include the 'host' part when advertise-addr is not set", c.WorkerAddr)
if host == "" || host == "0.0.0.0" {
return terror.ErrWorkerHostPortNotValid.Generatef("worker-addr (%s) must include the 'host' part (should not be '0.0.0.0') when advertise-addr is not set", c.WorkerAddr)
}
c.AdvertiseAddr = c.WorkerAddr
} else {
host, _, err = net.SplitHostPort(c.AdvertiseAddr)
if err != nil || host == "" {
return terror.ErrWorkerHostPortNotValid.Delegate(err, c.AdvertiseAddr)
if err != nil || host == "" || host == "0.0.0.0" {
return terror.ErrWorkerHostPortNotValid.AnnotateDelegate(err, "advertise-addr (%s) must include the 'host' part and should not be '0.0.0.0'", c.AdvertiseAddr)
}
}

Expand Down
1 change: 1 addition & 0 deletions tests/_utils/run_dm_worker
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ echo "[$(date)] <<<<<< START DM-WORKER on port $port, config: $conf >>>>>>"
cd $workdir
$binary -test.coverprofile="$TEST_DIR/cov.$TEST_NAME.worker.$port.$(date +"%s").out" DEVEL \
--worker-addr=0.0.0.0:$port \
--advertise-addr=127.0.0.1:$port \
--log-file="$workdir/log/dm-worker.log" -L=info --config="$conf" \
>> $workdir/log/stdout.log 2>&1 &
cd $PWD

0 comments on commit 2024c7c

Please sign in to comment.