Skip to content

Commit

Permalink
fix(rcmgr): improve error phrasing
Browse files Browse the repository at this point in the history
limits were not exceeded, manager protects us from that
ipfs#9432 (comment)
  • Loading branch information
lidel authored and ajnavarro committed Dec 2, 2022
1 parent c8a4b6a commit 0976595
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/node/libp2p/rcmgr_logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (n *loggingResourceManager) start(ctx context.Context) {
n.limitExceededErrs = make(map[string]int)

for e, count := range errs {
n.logger.Errorf("Resource limits were exceeded %d times with error %q.", count, e)
n.logger.Errorf("Protected from exceeding resource limits %d times: %q.", count, e)
}

if len(errs) != 0 {
Expand Down
2 changes: 1 addition & 1 deletion core/node/libp2p/rcmgr_logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestLoggingResourceManager(t *testing.T) {
if oLogs.Len() == 0 {
continue
}
require.Equal(t, "Resource limits were exceeded 2 times with error \"system: cannot reserve inbound connection: resource limit exceeded\".", oLogs.All()[0].Message)
require.Equal(t, "Protected from exceeding resource limits 2 times: \"system: cannot reserve inbound connection: resource limit exceeded\".", oLogs.All()[0].Message)
return
}
}
Expand Down

0 comments on commit 0976595

Please sign in to comment.