Skip to content

Commit

Permalink
fix goroutine leak (#14)
Browse files Browse the repository at this point in the history
* fix mem leak (#8)

* set conn deadline

* modify balance log level (#11)

* Use github actions for test (#13)

Co-authored-by: Yang Xiufeng <[email protected]>
  • Loading branch information
ariesdevil and youngsofun committed Dec 23, 2019
1 parent c76743b commit f425dd9
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 28 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on: [push, pull_request]
name: GoBeansProxy Test
jobs:
test:
strategy:
matrix:
go-version: [1.12.x, 1.13.x]
python-version: [2.x]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}

- name: Install Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Checkout code
uses: actions/checkout@v1

- name: Get test tools
run: go get -u -v golang.org/x/tools/cmd/goimports

- name: Prepare Test
run: pip install --user -r tests/pip-req.txt

- name: Test
run: |
export PATH=${PATH}:`go env GOPATH`/bin
diff <(goimports -d .) <(printf "")
go mod vendor
go get -u -v github.com/douban/gobeansdb
make test
- name: Install
run: make install
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ pytest:install
./tests/run_test.sh

install:
GO111MODULE=on go mod vendor
go install ./
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GoBeansproxy [![Build Status](https://travis-ci.org/douban/gobeansproxy.svg?branch=master)](https://travis-ci.org/douban/gobeansproxy)
# GoBeansProxy ![](https://github.com/douban/gobeansproxy/workflows/GoBeansProxy%20Test/badge.svg)

A proxy for [Gobeansdb](https://github.com/douban/gobeansdb).

Expand All @@ -11,6 +11,7 @@ Supported Go version: > 1.11.0
```
$ git clone http://github.com/douban/gobeansproxy.git
$ cd gobeansproxy
$ go mod vendor
$ make
```

Expand Down
2 changes: 1 addition & 1 deletion dstore/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (bucket *Bucket) balance() {
offsetOld = bucket.partition.offsets
bucket.partition.reBalance(fromHost, toHost, 1)
offsetNew = bucket.partition.offsets
logger.Errorf("bucket %d BALANCE: from host-%s-%d to host-%s-%d, make offsets %v to %v ", bucket.ID, bucket.hostsList[fromHost].host.Addr, fromHost, bucket.hostsList[toHost].host.Addr, toHost, offsetOld, offsetNew)
logger.Debugf("bucket %d BALANCE: from host-%s-%d to host-%s-%d, make offsets %v to %v ", bucket.ID, bucket.hostsList[fromHost].host.Addr, fromHost, bucket.hostsList[toHost].host.Addr, toHost, offsetOld, offsetNew)
}
}

Expand Down

0 comments on commit f425dd9

Please sign in to comment.