-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix connection close in exporter process
There were a couple of issues: * ConnToCollector is exposed to the consumers of the library, and in Antrea we call ConnToCollector whenever sending a record fails. So the library itself should not call ConnToCollector as this is inherently racy. For example, it is possible for templateRefCh to be closed twice, despite the isChanClosed test (check-then-act race). We could add a mutex and a boolean, but I feel like it is better to just let consumer call ConnToCollector. * When the exporter process is sending over UDP, there was a typo where a `break` was used instead of `return`. The `break` statement breaks from the select case, and not from the surrounding for loop, so the goroutine would never terminate. Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
- Loading branch information
1 parent
a4ae35d
commit c7836a4
Showing
2 changed files
with
14 additions
and
80 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