Skip to content

Commit 35fed02

Browse files
author
Ian Pye
committed
Updating to work with latest birdbrain
1 parent 7320a3d commit 35fed02

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

cluster/manager.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"logger"
77
"net/http"
88
"stash.cloudflare.com/go-stream/util/slog"
9+
"strconv"
910
"time"
1011
)
1112

@@ -46,8 +47,8 @@ type BBHost struct {
4647
Disk_free float32
4748
Load float32
4849
Name string
49-
Host string
50-
Port string
50+
Ip string
51+
Port int
5152
}
5253

5354
type BBResult struct {
@@ -76,7 +77,7 @@ func (c *DynamicBBManager) pullLatestEra() (err error) {
7677

7778
we := NewWeightedEra()
7879
for _, node := range bbr.Nodes {
79-
n := NewWeightedNode(node.Name, node.Host, node.Port, node.Disk_free, node.Load)
80+
n := NewWeightedNode(node.Name, node.Ip, strconv.Itoa(node.Port), node.Disk_free, node.Load)
8081
slog.Logf(logger.Levels.Debug, "Trasport LOG INFO %v", n)
8182
we.Add(n)
8283
}
@@ -95,8 +96,14 @@ func (c *DynamicBBManager) pullLatestEra() (err error) {
9596

9697
// Once we have hit one BB server with no error, no need to try any others.
9798
break
99+
} else {
100+
slog.Logf(logger.Levels.Error, "Unmarshal Error %v", err)
98101
}
102+
} else {
103+
slog.Logf(logger.Levels.Error, "Read Error %v", err)
99104
}
105+
} else {
106+
slog.Logf(logger.Levels.Error, "Network GET Error %v", err)
100107
}
101108
}
102109
return

stream/source/unixgram/unixgram.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ func NewUnixgramSource(sockPath string) *UnixgramSource {
3030
return &unixsrc
3131
}
3232

33+
// NOTE: nginx escapes chars in 0x7F-0x1F range into \xXX format for access logs.
34+
// Try and de-code only these chars
3335
func (src *UnixgramSource) decodeNginxLog(log []byte) int {
3436
var (
3537
writeIndex, readIndex int // next index to write to

0 commit comments

Comments
 (0)