Commit Graph

15 Commits

Author SHA1 Message Date
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
Jae Kwon ff230682d1
Fix logical time (#122)
Should fix a nondeterministic bug so...
2018-02-02 12:51:30 +04:00
Ethan Buchman 92c17f3f25 give test more time 2017-12-29 10:49:49 -05:00
Jae Kwon a171d90611 Fix possibly incorrect usage of conversion 2017-12-29 10:28:00 -05:00
Ethan Buchman 558f8e7769 fix recursion 2017-12-29 10:28:00 -05:00
Ethan Buchman 76433d9040 little things 2017-12-29 10:28:00 -05:00
Jae Kwon 6b5d08f7da RepeatTimer fix 2017-12-29 10:27:54 -05:00
Ethan Buchman b0b740210c cmn: fix repeate timer test with manual ticker 2017-12-21 11:15:17 -05:00
Anton Kaliaev e17e8e425f
Revert "Refactor throttle timer" 2017-12-19 16:23:20 -06:00
Anton Kaliaev 70e30f74e6
Revert "Refactor repeat timer" 2017-12-19 16:16:16 -06:00
Ethan Frey cc7a87e27c Use Ticker in Repeat again to avoid drift 2017-12-07 11:22:54 +01:00
Ethan Frey 8797197cdf No more blocking on multiple Stop() 2017-12-07 10:38:50 +01:00
Ethan Frey 887d766c86 Refactored RepeatTimer, tests hang 2017-12-07 10:15:38 +01:00
Ethan Frey 3d9113c16e Add a bit more padding to tests so they pass on osx with -race 2017-12-06 09:18:04 +01:00
Ethan Frey 26abd65e34 Add tests for repeat timer 2017-12-05 15:01:07 +01:00