Skip to content

Commit 28f8316

Browse files
committed
Add error log when negative refCount is detected
1 parent cf748fa commit 28f8316

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

plugins/outputs/cloudwatchlogs/cloudwatchlogs.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ func (cd *cwDest) NotifySourceStopped() {
279279
if cd.refCount <= 0 {
280280
cd.stop()
281281
}
282+
283+
if cd.refCount < 0 {
284+
fmt.Printf("E! Negative refCount on cwDest detected. refCount: %d, logGroup: %s, logStream: %s", cd.refCount, cd.pusher.Group, cd.pusher.Stream)
285+
}
282286
}
283287

284288
func (cd *cwDest) Stop() {

0 commit comments

Comments
 (0)