mirror of
https://github.com/libp2p/go-libp2p-resource-manager.git
synced 2025-01-28 05:10:26 +08:00
Merge pull request #5 from libp2p/fix/bug-log
downgrade BUG log to warning
This commit is contained in:
commit
8d6c5d0829
12
scope.go
12
scope.go
@ -96,7 +96,7 @@ func (rc *resources) releaseMemory(size int64) {
|
||||
|
||||
// sanity check for bugs upstream
|
||||
if rc.memory < 0 {
|
||||
log.Error("BUG: too much memory released")
|
||||
log.Warn("BUG: too much memory released")
|
||||
rc.memory = 0
|
||||
}
|
||||
}
|
||||
@ -137,11 +137,11 @@ func (rc *resources) removeStreams(incount, outcount int) {
|
||||
rc.nstreamsOut -= outcount
|
||||
|
||||
if rc.nstreamsIn < 0 {
|
||||
log.Error("BUG: too many inbound streams released")
|
||||
log.Warn("BUG: too many inbound streams released")
|
||||
rc.nstreamsIn = 0
|
||||
}
|
||||
if rc.nstreamsOut < 0 {
|
||||
log.Error("BUG: too many outbound streams released")
|
||||
log.Warn("BUG: too many outbound streams released")
|
||||
rc.nstreamsOut = 0
|
||||
}
|
||||
}
|
||||
@ -198,15 +198,15 @@ func (rc *resources) removeConns(incount, outcount, fdcount int) {
|
||||
rc.nfd -= fdcount
|
||||
|
||||
if rc.nconnsIn < 0 {
|
||||
log.Error("BUG: too many inbound connections released")
|
||||
log.Warn("BUG: too many inbound connections released")
|
||||
rc.nconnsIn = 0
|
||||
}
|
||||
if rc.nconnsOut < 0 {
|
||||
log.Error("BUG: too many outbound connections released")
|
||||
log.Warn("BUG: too many outbound connections released")
|
||||
rc.nconnsOut = 0
|
||||
}
|
||||
if rc.nfd < 0 {
|
||||
log.Error("BUG: too many file descriptors released")
|
||||
log.Warn("BUG: too many file descriptors released")
|
||||
rc.nfd = 0
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user