-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(notifier): Fixed race in notifier test Race condition was when accessing to SelfCheckWorker.Heartbeats on read because creation of Heartbeats was in worker goroutine (Start -> selfStateChecker). Fixed race condition by moving heartbeats creation to constructor of SelfCheckWorker. Made heartbeats internal to pay attention that it is not public by design. Created error variables to indicate that self state monitor is not started. * fix(notifier): Fixed race in index test Race condition was when accessing to trigger count without atomic on read. Fixed race by adding atomic load. * feature: Added race flag to tests Now tests will run with ``-race` flag to find data races at testing time. * Log only. Also change to Info log level because it is just information about self checker state, it is expected behavior if checker is off * remove unnecessary `.Error()` call * don't log twice * remove useless .Error() call * godoc * refactor: Remove dead code Seems `Stop` method works without these checks. It is strange to check `Enabled` and check config in Stop method, I think checks in `Start` method is enough. Also remove test, it is meaningless to test Stop method without Start method. * refactor: SelfStateChecker system design As I understand It is bad system design - each method must check Enabled flag. I rewrite it to new design, in which SelfCheckWorker instance will be created (initialized) in main func only if Enabled is true. * Log if disabled * fix log * CI: upd ubuntu version * linter version
- Loading branch information
1 parent
6175cb3
commit fe53343
Showing
9 changed files
with
100 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters