Skip to content

Commit f425dd9

Browse files
fix goroutine leak (#14)
* 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]>
1 parent c76743b commit f425dd9

File tree

5 files changed

+43
-28
lines changed

5 files changed

+43
-28
lines changed

.github/workflows/go.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on: [push, pull_request]
2+
name: GoBeansProxy Test
3+
jobs:
4+
test:
5+
strategy:
6+
matrix:
7+
go-version: [1.12.x, 1.13.x]
8+
python-version: [2.x]
9+
platform: [ubuntu-latest, macos-latest]
10+
runs-on: ${{ matrix.platform }}
11+
steps:
12+
- name: Install Go
13+
uses: actions/setup-go@v1
14+
with:
15+
go-version: ${{ matrix.go-version }}
16+
17+
- name: Install Python
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Checkout code
23+
uses: actions/checkout@v1
24+
25+
- name: Get test tools
26+
run: go get -u -v golang.org/x/tools/cmd/goimports
27+
28+
- name: Prepare Test
29+
run: pip install --user -r tests/pip-req.txt
30+
31+
- name: Test
32+
run: |
33+
export PATH=${PATH}:`go env GOPATH`/bin
34+
diff <(goimports -d .) <(printf "")
35+
go mod vendor
36+
go get -u -v github.com/douban/gobeansdb
37+
make test
38+
39+
- name: Install
40+
run: make install

.travis.yml

-25
This file was deleted.

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ pytest:install
1717
./tests/run_test.sh
1818

1919
install:
20-
GO111MODULE=on go mod vendor
2120
go install ./

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# GoBeansproxy [![Build Status](https://travis-ci.org/douban/gobeansproxy.svg?branch=master)](https://travis-ci.org/douban/gobeansproxy)
1+
# GoBeansProxy ![](https://github.com/douban/gobeansproxy/workflows/GoBeansProxy%20Test/badge.svg)
22

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

@@ -11,6 +11,7 @@ Supported Go version: > 1.11.0
1111
```
1212
$ git clone http://github.com/douban/gobeansproxy.git
1313
$ cd gobeansproxy
14+
$ go mod vendor
1415
$ make
1516
```
1617

dstore/bucket.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (bucket *Bucket) balance() {
104104
offsetOld = bucket.partition.offsets
105105
bucket.partition.reBalance(fromHost, toHost, 1)
106106
offsetNew = bucket.partition.offsets
107-
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)
107+
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)
108108
}
109109
}
110110

0 commit comments

Comments
 (0)