Skip to content
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

nsqadmin: fix regression when querying nsqd directly #652

Merged
merged 1 commit into from
Sep 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/nsqadmin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"time"

"github.com/BurntSushi/toml"
"github.com/mreiferson/go-options"
"github.com/nsqio/nsq/internal/app"
"github.com/nsqio/nsq/internal/version"
"github.com/nsqio/nsq/nsqadmin"
"github.com/mreiferson/go-options"
)

var (
Expand Down
11 changes: 11 additions & 0 deletions internal/clusterinfo/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package clusterinfo
import (
"errors"
"fmt"
"net"
"net/url"
"sort"
"strconv"
"strings"
"sync"

Expand Down Expand Up @@ -495,6 +497,15 @@ func (c *ClusterInfo) GetNSQDTopicProducers(topic string, nsqdHTTPAddrs []string
version, _ = semver.Parse("0.0.0")
}

// if BroadcastAddress/HTTPPort are missing, use the values from `addr` for
// backwards compatibility

if infoResp.BroadcastAddress == "" {
var p string
infoResp.BroadcastAddress, p, _ = net.SplitHostPort(addr)
infoResp.HTTPPort, _ = strconv.Atoi(p)
}

lock.Lock()
producers = append(producers, &Producer{
Version: infoResp.Version,
Expand Down