Skip to content

Commit

Permalink
Fix panic on atomic operation on non 64bit align variables
Browse files Browse the repository at this point in the history
We now also run tests on 32bit and ARM.
  • Loading branch information
hush-hush committed Jun 16, 2020
1 parent cabc452 commit 8ff9a8a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
19 changes: 18 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
language: go

arch:
- amd64
- arm64

go:
- 1.8
- 1.9
Expand All @@ -9,7 +13,20 @@ go:
- 1.13.x
- 1.14.x

# test 32bit build too.
jobs:
include:
- arch: amd64
go: 1.14.x
script:
- GOARCH=386 go test -v ./...
- arch: amd64
go: 1.8
script:
- GOARCH=386 go test -v ./...

script:
- go test -race -v ./...
# race detector is only available on amd64
- if [[ "$TRAVIS_CPU_ARCH" == "amd64" ]]; then go test -race -v ./...; else go test -v ./...; fi
- go vet ./...
- "[ -z \"`go fmt ./...`\" ]"
3 changes: 2 additions & 1 deletion statsd/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type sender struct {
transport statsdWriter
pool *bufferPool
queue chan *statsdBuffer
metrics SenderMetrics
metrics *SenderMetrics
stop chan struct{}
}

Expand All @@ -40,6 +40,7 @@ func newSender(transport statsdWriter, queueSize int, pool *bufferPool) *sender
transport: transport,
pool: pool,
queue: make(chan *statsdBuffer, queueSize),
metrics: &SenderMetrics{},
stop: make(chan struct{}),
}

Expand Down
3 changes: 2 additions & 1 deletion statsd/statsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ type Client struct {
flushTime time.Duration
bufferPool *bufferPool
buffer *statsdBuffer
metrics ClientMetrics
metrics *ClientMetrics
telemetryTags []string
stop chan struct{}
wg sync.WaitGroup
Expand Down Expand Up @@ -307,6 +307,7 @@ func newWithWriter(w statsdWriter, o *Options, writerName string) (*Client, erro
c := Client{
Namespace: o.Namespace,
Tags: o.Tags,
metrics: &ClientMetrics{},
}
if o.Aggregation {
c.agg = newAggregator(&c)
Expand Down

0 comments on commit 8ff9a8a

Please sign in to comment.