From 1f2e83039118d910d0bbf9acd6561c3d32c82c3a Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Wed, 6 Jul 2022 17:31:10 -0500 Subject: [PATCH] helpful error message when mmap limit can't change (#26450) --- ledger/src/blockstore.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs index 64c4a5568..a126d7bef 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -4278,12 +4278,13 @@ fn adjust_ulimit_nofile(enforce_ulimit_nofile: bool) -> Result<()> { } let mut nofile = get_nofile(); - if nofile.rlim_cur < desired_nofile { + let current = nofile.rlim_cur; + if current < desired_nofile { nofile.rlim_cur = desired_nofile; if unsafe { libc::setrlimit(libc::RLIMIT_NOFILE, &nofile) } != 0 { error!( - "Unable to increase the maximum open file descriptor limit to {}", - desired_nofile + "Unable to increase the maximum open file descriptor limit to {} from {}", + nofile.rlim_cur, current, ); if cfg!(target_os = "macos") {