@cryptotaxi247 / kubo / commits / 09765951e

fix(rcmgr): improve error phrasing

limits were not exceeded, manager protects us from that https://github.com/ipfs/kubo/issues/9432#issuecomment-1334160936

Marcin Rataj committed Dec 1, 2022 at 22:15 UTC 09765951ea172d3cf6d0b12031ad97635ee2ad02
2 files changed +2 -2
core/node/libp2p/rcmgr_logging.go
+1 -1
@@ -50,7 +50,7 @@ func (n *loggingResourceManager) start(ctx context.Context) {
50 n.limitExceededErrs = make(map[string]int)
51
52 for e, count := range errs {
53 - n.logger.Errorf("Resource limits were exceeded %d times with error %q.", count, e)
53 + n.logger.Errorf("Protected from exceeding resource limits %d times: %q.", count, e)
54 }
55
56 if len(errs) != 0 {
core/node/libp2p/rcmgr_logging_test.go
+1 -1
@@ -55,7 +55,7 @@ func TestLoggingResourceManager(t *testing.T) {
55 if oLogs.Len() == 0 {
56 continue
57 }
58 - require.Equal(t, "Resource limits were exceeded 2 times with error \"system: cannot reserve inbound connection: resource limit exceeded\".", oLogs.All()[0].Message)
58 + require.Equal(t, "Protected from exceeding resource limits 2 times: \"system: cannot reserve inbound connection: resource limit exceeded\".", oLogs.All()[0].Message)
59 return
60 }
61 }