Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cns/logger/cnslogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@
if err != nil {
l.Errorf("Failed to get zap Platform cores: %v", err)
}
zapLogger := zap.New(platformCore, zap.AddCaller()).With(zap.Int("pid", os.Getpid()))

Check failure on line 48 in cns/logger/cnslogger.go

View workflow job for this annotation

GitHub Actions / Lint (windows-latest)

File is not properly formatted (gci)

Check failure on line 48 in cns/logger/cnslogger.go

View workflow job for this annotation

GitHub Actions / Lint (ubuntu-latest)

File is not properly formatted (gci)
zapLogger := zap.New(
platformCore,
zap.AddCaller(),
zap.AddStacktrace(zapcore.WarnLevel),
).With(zap.Int("pid", os.Getpid()))

return &logger{
logger: l,
Expand Down
2 changes: 1 addition & 1 deletion cns/restserver/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (a *asyncMetricsRecorder) record() {
func (service *HTTPRestService) publishIPStateMetrics() {
recorder.once.Do(func() {
recorder.podIPConfigSrc = service.PodIPConfigStates
recorder.sig = make(chan struct{})
recorder.sig = make(chan struct{}, 1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disagree with this change, unless this can't be called more than twice concurrently (and if that was the case, why twice instead of once and leave this unbuffered?). this smells and indicates some other structural problem.
all it does is delay when you will get a blocking send by one more event. maybe sig should only have non-blocking sends?

go recorder.run()
})
select {
Expand Down
Loading