bitcoin: MacOS: `importdescriptors` RPC call very slow with release and source-built binaries, but fast for homebrew binaries
I’m working on a project on MacOS that makes RPC calls using the Rust bitcoincore-rpc crate, against the bitcoind prebuilt binary available here.
Some RPC calls succeed, but some fail with this error:
Error: Rpc(JsonRpc(Transport(SocketError(Os { code: 35, kind: WouldBlock, message: "Resource temporarily unavailable" }))))
After much debugging, we found that when we used the version of bitcoind
provided by homebrew, the exact same sequence of RPC calls would succeed. We were able to reproduce this on both an x86 mac and an ARM mac.
We haven’t been able to figure out what the disparity is, but looking at the homebrew bitcoind formula defiinition might provide some clues.
In particular:
def install
system "./autogen.sh"
system "./configure", *std_configure_args,
"--disable-dependency-tracking",
"--disable-silent-rules",
"--with-boost-libdir=#{Formula["boost@1.76"].opt_lib}"
system "make", "install"
pkgshare.install "share/rpcauth"
end
It looks like homebrew is passing additional arguments to configure
, std_configure_args
, and is using a version of boost built by homebrew. I tried using brew install -s boost@1.76 bitcoind
, to see if this also produced a binary that worked, and it did. The logs from that build are available here.
I’ve run into similar problems like this one a few times before, i.e., RPC calls to bitcoind failing on MacOS due to inscrutable I/O errors. One time, I was able to fix it by increasing the open file limit using ulimit -n BIG_NUMBER
, but that doesn’t seem to work here.
My best guess is that the homebrew poeople have gotten pretty good at configuring packages on MacOS, and they’re passing some flag, or using a patched version of boost, or linking it differently, such that the binary they produce isn’t affected by this issue.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 16 (16 by maintainers)
Commits related to this issue
- Revert "build: Use Homebrew's sqlite package if it is available" This reverts ee7b84e63cbeadd5e680d69ff0548275581e9241 from #20527. This change was made without any rationale, maybe other than a brew... — committed to fanquake/bitcoin by fanquake 2 years ago
- Merge bitcoin/bitcoin#25985: Revert "build: Use Homebrew's sqlite package if it is available" d216d714aae36e6f1c95f82aef81a0be74dee2f3 Revert "build: Use Homebrew's sqlite package if it is available"... — committed to bitcoin-core/gui by achow101 2 years ago
- Revert "build: Use Homebrew's sqlite package if it is available" This reverts ee7b84e63cbeadd5e680d69ff0548275581e9241 from #20527. This change was made without any rationale, maybe other than a brew... — committed to fanquake/bitcoin by fanquake 2 years ago
- Revert "build: Use Homebrew's sqlite package if it is available" This reverts ee7b84e63cbeadd5e680d69ff0548275581e9241 from #20527. This change was made without any rationale, maybe other than a brew... — committed to adam2k/bitcoin by fanquake 2 years ago
- Revert "build: Use Homebrew's sqlite package if it is available" This reverts ee7b84e63cbeadd5e680d69ff0548275581e9241 from #20527. This change was made without any rationale, maybe other than a brew... — committed to fanquake/bitcoin by fanquake 2 years ago
- Merge bitcoin/bitcoin#25985: Revert "build: Use Homebrew's sqlite package if it is available" d216d714aae36e6f1c95f82aef81a0be74dee2f3 Revert "build: Use Homebrew's sqlite package if it is available"... — committed to syscoin/syscoin by achow101 2 years ago
- Revert "build: Use Homebrew's sqlite package if it is available" This reverts ee7b84e63cbeadd5e680d69ff0548275581e9241 from #20527. This change was made without any rationale, maybe other than a brew... — committed to satsie/bitcoin by fanquake 2 years ago
- backports from upstream 22.1 (#208) * rpc: Capture potentially large UniValue by ref for rpcdoccheck Github-Pull: 25237 Rebased-From: 20ff4991e548630d7bb5e491fa4d69ec49369872 * Add pure Python... — committed to vertcoin-project/vertcoin-core by vertiond 2 years ago
- Revert "build: Use Homebrew's sqlite package if it is available" This reverts ee7b84e63cbeadd5e680d69ff0548275581e9241 from #20527. This change was made without any rationale, maybe other than a brew... — committed to BitgesellOfficial/bitgesell by fanquake 2 years ago
I’ve opened #25985 to resolve the build from source half of this issue, and have a few changes to make to our sqlite build in depends that might offer some minor performance improvement (although for all platforms).
#25985 was merged.
Could this depend on a folder where binary resides?