tendermint/common
Anton Kaliaev 52ce4c20f8
Fix RepeatTimer memory leak (#137)
fix RepeatTimer memory leak (Refs #137)

* test case

* drain channels on reset

Leaking memory:
```
leaktest.go:144: leaktest: leaked goroutine: goroutine 116 [chan send]:
        github.com/tendermint/tmlibs/common.(*RepeatTimer).fireRoutine(0xc42006a410, 0xc4203403c0, 0xc42031b2c0)
                /go/src/github.com/tendermint/tmlibs/common/repeat_timer.go:160 +0x6e
        created by github.com/tendermint/tmlibs/common.(*RepeatTimer).reset
                /go/src/github.com/tendermint/tmlibs/common/repeat_timer.go:196 +0xe9
```

The alternative solution could be draining channels on the client side.

* add one more select instead of draining

thanks to Jae
2018-02-09 13:31:32 +04:00
..
LICENSE move all files to common/ to begin repo merge 2017-04-18 16:33:22 -04:00
array.go move all files to common/ to begin repo merge 2017-04-18 16:33:22 -04:00
async.go move all files to common/ to begin repo merge 2017-04-18 16:33:22 -04:00
bit_array.go common/BitArray: reduce fragility with methods 2018-02-06 01:12:24 -08:00
bit_array_test.go common/BitArray: reduce fragility with methods 2018-02-06 01:12:24 -08:00
bytes.go cmn: fix HexBytes.MarshalJSON 2018-01-02 11:05:53 -05:00
bytes_test.go cmn: fix HexBytes.MarshalJSON 2018-01-02 11:05:53 -05:00
byteslice.go common: Fingerprint comment 2017-09-20 02:49:51 -04:00
cmap.go Make iterating over keys possible (#63) 2017-11-04 00:06:20 -05:00
cmap_test.go use assert.Contains in cmap_test 2017-11-04 00:10:59 -05:00
colors.go move all files to common/ to begin repo merge 2017-04-18 16:33:22 -04:00
date.go changelog and PR changes 2017-06-20 17:18:55 -04:00
date_test.go changelog and PR changes 2017-06-20 17:18:55 -04:00
errors.go Deprecated Panic* 2017-12-09 09:26:03 -08:00
heap.go Add PushBytes to Heap 2017-12-10 14:23:27 -08:00
int.go IntInSlice and StringInSlice functions 2017-11-29 12:18:03 -06:00
int_test.go IntInSlice and StringInSlice functions 2017-11-29 12:18:03 -06:00
io.go move all files to common/ to begin repo merge 2017-04-18 16:33:22 -04:00
kvpair.go Remove Bytes, just use []byte; Use protobuf for KVPair/KI64Pair 2017-12-26 04:40:35 -08:00
math.go move all files to common/ to begin repo merge 2017-04-18 16:33:22 -04:00
net.go common: ProtocolAndAddress 2017-07-19 15:02:04 -04:00
net_test.go common: ProtocolAndAddress 2017-07-19 15:02:04 -04:00
os.go use os.Process#Kill (Fixes #73) 2017-11-04 08:14:47 -05:00
os_test.go make GoPath a function 2017-10-25 11:01:52 +04:00
random.go cmn: fix race condition in prng 2017-12-21 10:02:25 -05:00
random_test.go common: Rand* warnings about cryptographic unsafety 2017-12-15 22:41:36 -07:00
repeat_timer.go Fix RepeatTimer memory leak (#137) 2018-02-09 13:31:32 +04:00
repeat_timer_test.go Fix RepeatTimer memory leak (#137) 2018-02-09 13:31:32 +04:00
service.go common: comments for Service 2017-11-29 05:16:15 +00:00
service_test.go remove bool from Service#Reset 2017-11-27 23:42:36 -06:00
string.go common: IsHex should be able to handle 0X prefixed strings 2018-02-02 23:41:24 -07:00
string_test.go common: IsHex should be able to handle 0X prefixed strings 2018-02-02 23:41:24 -07:00
throttle_timer.go Revert "Refactor throttle timer" 2017-12-19 16:23:20 -06:00
throttle_timer_test.go Revert "Refactor throttle timer" 2017-12-19 16:23:20 -06:00
types.pb.go Remove Bytes, just use []byte; Use protobuf for KVPair/KI64Pair 2017-12-26 04:40:35 -08:00
types.proto Remove Bytes, just use []byte; Use protobuf for KVPair/KI64Pair 2017-12-26 04:40:35 -08:00
word.go move all files to common/ to begin repo merge 2017-04-18 16:33:22 -04:00