Skip to content

Conversation

meshcollider
Copy link
Contributor

Fixes #18622

A bug in WSL means that fcntl does not exclusively lock files, allowing multiple instances of bitcoin to use the same datadir. If we instead use flock, it works correctly. Passes Travis, but testing on some OS variety would be sensible.

From what I can tell, flock and fcntl don't work with each other on linux, so it would still be possible to run a node with this code change and a node before it with the same datadir (this isn't true for Mac/FreeBSD). flock also doesn't support NFS on MacOS and linux<2.6.12 while fcntl did. See here for example: https://gavv.github.io/articles/file-locks/

If changing to flock for all systems is inadvisable, it would also be possible to just detect WSL and use flock when on that platform to avoid the bug.

@DrahtBot
Copy link
Contributor

Gitian builds

File commit 6ae99aa
(master)
commit 1a36387
(master and this pull)
bitcoin-0.20.99-aarch64-linux-gnu-debug.tar.gz 9e74baea5087f75d... dd9caf6fa1126a3f...
bitcoin-0.20.99-aarch64-linux-gnu.tar.gz b97f8fed4ef242bc... 5a3144105bfe97ca...
bitcoin-0.20.99-arm-linux-gnueabihf-debug.tar.gz c3cafca0d2c385b7... 16c59265a3f49440...
bitcoin-0.20.99-arm-linux-gnueabihf.tar.gz 9cf7842f6c7e72f9... d3117c583c9ae443...
bitcoin-0.20.99-osx-unsigned.dmg b8882f2b1e257bee... 279210aeb73a73ea...
bitcoin-0.20.99-osx64.tar.gz 9100c2ace54ffeb2... fc5834c15be4b962...
bitcoin-0.20.99-riscv64-linux-gnu-debug.tar.gz e3794553bdeb3406... 2f6bad18dccf3b6f...
bitcoin-0.20.99-riscv64-linux-gnu.tar.gz 3d60c7b6ad3a3b7a... 05d470ffe6c8efac...
bitcoin-0.20.99-win64-debug.zip 923a2a8d708b1196... 33b8e7fbaabee227...
bitcoin-0.20.99-win64-setup-unsigned.exe 4fd60fb4ee6d252a... e32c5565b0039492...
bitcoin-0.20.99-win64.zip 014a0e245da57de1... f74643de10c60c9c...
bitcoin-0.20.99-x86_64-linux-gnu-debug.tar.gz 6b72060bfdf9cd8a... 21ddfffa1ee0f8e9...
bitcoin-0.20.99-x86_64-linux-gnu.tar.gz d2e0d4726ecd84f6... 9eec3e7ef9c754bc...
bitcoin-0.20.99.tar.gz 5f8eaab85a59877b... fe3dd2ab68a6220f...
bitcoin-core-linux-0.21-res.yml b9c0b8516f1f7476... 799ccd04f4502d7c...
bitcoin-core-osx-0.21-res.yml aa56d3073ba6853c... fa86f0cc5bfb2217...
bitcoin-core-win-0.21-res.yml 127d7553b4c8553c... 938bc5b198d8f409...
linux-build.log 826d7ba2297e1251... 5d1e9e9b6410d255...
osx-build.log a889d7e96df8cc6a... 4023f21916323bf7...
win-build.log 6311c7e3c77d0b67... 37762874f39f9ee8...
bitcoin-core-linux-0.21-res.yml.diff eeb2e55b504104ca...
bitcoin-core-osx-0.21-res.yml.diff c465a6caf5f4f7d5...
bitcoin-core-win-0.21-res.yml.diff 6e7e44435c9ef0a9...
linux-build.log.diff b6ed5e37226cd11c...
osx-build.log.diff 67b8c8e6f6898f29...
win-build.log.diff c39e17d5668588b9...

@laanwj
Copy link
Member

laanwj commented Apr 22, 2020

If this is a bug in WSL, why not wait for them to fix it instead? I don't think it's desirable to change our handling of locks on all UNIX platforms just for a bug in their implementation. If we need is, please add it for WSL only and add a comment that it can be removed again when the upstream bug is fixed (with a link to the upstream bug).

@laanwj
Copy link
Member

laanwj commented Apr 22, 2020

Can you please test that this fixes your issue @mtrycz.

@meshcollider
Copy link
Contributor Author

meshcollider commented Apr 22, 2020

@laanwj the bug was reported upstream in 2017 with no fix in sight, so it seems it is up to us

@mtrycz
Copy link

mtrycz commented Apr 22, 2020

I've ran my test plan (from the related issue), and I can confirm that the test fails in the latest master 9e8e813d and the v0.19.1 tag, and that it passes in this Pull Request.

However, I'm running more extended tests and some are failing. Please allow some time to make an adequate description.

@wumpus
Copy link

wumpus commented Apr 22, 2020

Github @wumpus is not bitcoin wumpus.

src/fs.cpp Outdated
// Exclusive file locking is broken on WSL using fcntl (issue #18622)
// This workaround can be removed once the bug on WSL is fixed
struct utsname uname_data;
if (uname(&uname_data) == 0 && std::string(uname_data.version).find("Microsoft") != std::string::npos) {
Copy link
Member

@sipa sipa Apr 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition should probably be cached in a static bool local variable.

EDIT: and only conditionally compiled for WIN32?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sipa it isn't "win32" because its the linux subsystem, so it runs in the non-windows branch

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still, please cache the result.

@mtrycz
Copy link

mtrycz commented Apr 23, 2020

I have ran test/functional/test_runner.py several times both on master and this PR.

The specific issue is solved for WSL on this PR's code.

There are also several test failures (on both branches) that are reproducible, and some that are non-deterministic. If this sounds new, should I open a new issue with this?

src/fs.cpp Outdated
// Exclusive file locking is broken on WSL using fcntl (issue #18622)
// This workaround can be removed once the bug on WSL is fixed
// Cache the result to avoid multiple system calls
static bool is_wsl_cache_exists = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a crazy edge case, and unlikely on realistic platforms, but this is technically UB if two threads simultaneously reach the if (!is_wsl_cache_exists) check. The most C++ish solution is this I think: sipa@9470c59.

@luke-jr
Copy link
Member

luke-jr commented Apr 24, 2020

Is there any reason we can't check/take both locks?

Co-authored-by: sipa <pieter@wuille.net>
@meshcollider
Copy link
Contributor Author

Thanks @sipa, updated :)

@laanwj
Copy link
Member

laanwj commented May 11, 2020

I'm removing this from the 0.20.0 milestone. It's not a regression in 0.20, it's an upstream bug in "Linux emulation", and I think this fix is not quite ready yet.

@laanwj laanwj modified the milestones: 0.20.0, 0.20.1 May 11, 2020
@laanwj
Copy link
Member

laanwj commented May 28, 2020

Code review ACK e8fa0a3

@laanwj laanwj merged commit ea3e9e0 into bitcoin:master May 28, 2020
@@ -47,20 +50,38 @@ FileLock::~FileLock()
}
}

static bool IsWSL()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized after merging that we could shortcut this check to false on non-x86 platforms. But it doesn't matter too much.

@maflcko
Copy link
Member

maflcko commented May 28, 2020

Tagged with " Needs backport (0.20) "

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 29, 2020
e8fa0a3 Fix WSL file locking by using flock instead of fcntl (Samuel Dobson)

Pull request description:

  Fixes bitcoin#18622

  A bug in WSL means that fcntl does not exclusively lock files, allowing multiple instances of bitcoin to use the same datadir. If we instead use flock, it works correctly. Passes Travis, but testing on some OS variety would be sensible.

  From what I can tell, flock and fcntl don't work with each other on linux, so it would still be possible to run a node with this code change and a node before it with the same datadir (this isn't true for Mac/FreeBSD). flock also doesn't support NFS on MacOS and linux<2.6.12 while fcntl did. See here for example: https://gavv.github.io/articles/file-locks/

  If changing to flock for all systems is inadvisable, it would also be possible to just detect WSL and use flock when on that platform to avoid the bug.

ACKs for top commit:
  laanwj:
    Code review ACK e8fa0a3

Tree-SHA512: ca1009e171970101f1dc2332c5e998717aee00eebc80bb586b826927a74bd0d4c94712e46d1396821bc30533d76deac391b6e1c406c406865661f57fa062c702
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request May 29, 2020
Summary:
Co-authored-by: sipa <pieter@wuille.net>

Backport of Core [[bitcoin/bitcoin#18700 | PR18700]]

Test Plan:
On WSL
  ninja check
  ninja check-functional
Confirm all tests pass except `feature_proxy.py` (fails), `rpc_bind.py` (skipped), and `interface_zmq.py` (skipped).

Using two different consoles:
  src/bitcoind
Verify this fails on the second console with the following error:
  Error: Cannot obtain a lock on data directory <path>/.bitcoin. Bitcoin ABC is probably already running.

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, jasonbcox

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D6299
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Jun 9, 2020
Co-authored-by: sipa <pieter@wuille.net>

Github-Pull: bitcoin#18700
Rebased-From: e8fa0a3
@fanquake fanquake mentioned this pull request Jun 9, 2020
ComputerCraftr pushed a commit to ComputerCraftr/bitcoin that referenced this pull request Jun 10, 2020
e8fa0a3 Fix WSL file locking by using flock instead of fcntl (Samuel Dobson)

Pull request description:

  Fixes bitcoin#18622

  A bug in WSL means that fcntl does not exclusively lock files, allowing multiple instances of bitcoin to use the same datadir. If we instead use flock, it works correctly. Passes Travis, but testing on some OS variety would be sensible.

  From what I can tell, flock and fcntl don't work with each other on linux, so it would still be possible to run a node with this code change and a node before it with the same datadir (this isn't true for Mac/FreeBSD). flock also doesn't support NFS on MacOS and linux<2.6.12 while fcntl did. See here for example: https://gavv.github.io/articles/file-locks/

  If changing to flock for all systems is inadvisable, it would also be possible to just detect WSL and use flock when on that platform to avoid the bug.

ACKs for top commit:
  laanwj:
    Code review ACK e8fa0a3

Tree-SHA512: ca1009e171970101f1dc2332c5e998717aee00eebc80bb586b826927a74bd0d4c94712e46d1396821bc30533d76deac391b6e1c406c406865661f57fa062c702
@cculianu
Copy link

Note that this patch only answers the question IsWSL? for WSL ver 1. Ver 2 returns a totally different uts_name.version string as such:

WSL2 uts_name.version string: #1 SMP Wed Feb 19 06:37:35 UTC 2020

$ uname -a
Linux DESKTOP-TPEL8HN 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

I am running on Win10 WSL2 with Ubuntu 20.04. See the attached C++ test program to convince yourself.

#include <iostream>
#include <string>

#include <sys/file.h>
#include <sys/utsname.h>

static bool IsWSL(std::string *out = nullptr) {
	struct utsname uname_data;
	auto res = uname(&uname_data);
	std::string ver{uname_data.version};
	bool ret = res == 0 && ver.find("Microsoft") != std::string::npos;
	if (out) *out = std::move(ver);
	return ret;
}

int main()
{
	using std::cout;

	std::string ver;
	auto b = IsWSL(&ver);
	cout << "Ver: " << ver << '\n';
	cout << "IsWSL?: " << b << '\n';
	return 0;
}

I don't know if the bug #18622 is still an issue on WSL2. I'm going to try and determine this and write back here when I do.

@cculianu
Copy link

cculianu commented Jun 18, 2020

Follow-up: Can confirm that the upstream bug from microsoft on fcntl F_SETLK is fixed on WSL2. The linux/unix execution path that is taken on WSL2 (because IsWSL() returns false here) leads to correct behavior and the lock succeeds.

Suggest: Rename this function to IsWSL1 to make it clearer when it will return true and/or add a comment to that effect...

fanquake added a commit that referenced this pull request Jul 10, 2020
2b79ac7 Clean up separated ban/discourage interface (Pieter Wuille)
0477348 Replace automatic bans with discouragement filter (Pieter Wuille)
e7f06f9 test: remove Cirrus CI FreeBSD job (fanquake)
eb6b82a qa: Test concurrent wallet loading (João Barbosa)
c9b49d2 wallet: Handle concurrent wallet loading (João Barbosa)
cf0b5a9 tests: Check that segwit inputs in psbt have both UTXO types (Andrew Chow)
3228b59 psbt: always put a non_witness_utxo and don't remove it (Andrew Chow)
ed5ec30 psbt: Allow both non_witness_utxo and witness_utxo (Andrew Chow)
68e0e6f rpc: show both UTXOs in decodepsbt (Andrew Chow)
27786d0 trivial: Suggested cleanups to surrounding code (Russell Yanofsky)
654420d wallet: Minimal fix to restore conflicted transaction notifications (Russell Yanofsky)
febebc4 Fix WSL file locking by using flock instead of fcntl (Samuel Dobson)
5c7151a gui: update Qt base translations for macOS release (fanquake)
c219d21 build: improved output of configure for build OS (sachinkm77)
0596a6e util: Don't reference errno when pthread fails. (MIZUTA Takeshi)

Pull request description:

  Currently backports the following to the 0.20 branch:
  * #18700 - Fix locking on WSL using flock instead of fcntl
  * #18982 - wallet: Minimal fix to restore conflicted transaction notifications
  * #19059 - gui: update Qt base translations for macOS release
  * #19152 - build: improve build OS configure output
  * #19194 -  util: Don't reference errno when pthread fails.
  * #19215 - psbt: Include and allow both non_witness_utxo and witness_utxo for segwit inputs
  * #19219 - Replace automatic bans with discouragement filter
  * #19300 - wallet: Handle concurrent wallet loading

ACKs for top commit:
  amitiuttarwar:
    ACK 0477348 2b79ac7 by comparing to original changes, double checking the diff
  sipa:
    utACK 2b79ac7
  laanwj:
    ACK 2b79ac7

Tree-SHA512: e5eb31d08288fa4a6e8aba08e60b16ce1988f14f249238b1cfd18ab2c8f6fcd9f07e3c0c491d32d2361fca26e3037fb0374f37464bddcabecea29069d6737539
ftrader pushed a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this pull request Aug 17, 2020
Summary:
Co-authored-by: sipa <pieter@wuille.net>

Backport of Core [[bitcoin/bitcoin#18700 | PR18700]]

Test Plan:
On WSL
  ninja check
  ninja check-functional
Confirm all tests pass except `feature_proxy.py` (fails), `rpc_bind.py` (skipped), and `interface_zmq.py` (skipped).

Using two different consoles:
  src/bitcoind
Verify this fails on the second console with the following error:
  Error: Cannot obtain a lock on data directory <path>/.bitcoin. Bitcoin ABC is probably already running.

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, jasonbcox

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D6299
backpacker69 referenced this pull request in peercoin/peercoin Sep 8, 2020
Co-authored-by: sipa <pieter@wuille.net>

Github-Pull: #18700
Rebased-From: e8fa0a3
Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Oct 21, 2020
Co-authored-by: sipa <pieter@wuille.net>

Github-Pull: bitcoin#18700
Rebased-From: e8fa0a3
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 27, 2021
e8fa0a3 Fix WSL file locking by using flock instead of fcntl (Samuel Dobson)

Pull request description:

  Fixes bitcoin#18622

  A bug in WSL means that fcntl does not exclusively lock files, allowing multiple instances of bitcoin to use the same datadir. If we instead use flock, it works correctly. Passes Travis, but testing on some OS variety would be sensible.

  From what I can tell, flock and fcntl don't work with each other on linux, so it would still be possible to run a node with this code change and a node before it with the same datadir (this isn't true for Mac/FreeBSD). flock also doesn't support NFS on MacOS and linux<2.6.12 while fcntl did. See here for example: https://gavv.github.io/articles/file-locks/

  If changing to flock for all systems is inadvisable, it would also be possible to just detect WSL and use flock when on that platform to avoid the bug.

ACKs for top commit:
  laanwj:
    Code review ACK e8fa0a3

Tree-SHA512: ca1009e171970101f1dc2332c5e998717aee00eebc80bb586b826927a74bd0d4c94712e46d1396821bc30533d76deac391b6e1c406c406865661f57fa062c702
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 28, 2021
e8fa0a3 Fix WSL file locking by using flock instead of fcntl (Samuel Dobson)

Pull request description:

  Fixes bitcoin#18622

  A bug in WSL means that fcntl does not exclusively lock files, allowing multiple instances of bitcoin to use the same datadir. If we instead use flock, it works correctly. Passes Travis, but testing on some OS variety would be sensible.

  From what I can tell, flock and fcntl don't work with each other on linux, so it would still be possible to run a node with this code change and a node before it with the same datadir (this isn't true for Mac/FreeBSD). flock also doesn't support NFS on MacOS and linux<2.6.12 while fcntl did. See here for example: https://gavv.github.io/articles/file-locks/

  If changing to flock for all systems is inadvisable, it would also be possible to just detect WSL and use flock when on that platform to avoid the bug.

ACKs for top commit:
  laanwj:
    Code review ACK e8fa0a3

Tree-SHA512: ca1009e171970101f1dc2332c5e998717aee00eebc80bb586b826927a74bd0d4c94712e46d1396821bc30533d76deac391b6e1c406c406865661f57fa062c702
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 29, 2021
e8fa0a3 Fix WSL file locking by using flock instead of fcntl (Samuel Dobson)

Pull request description:

  Fixes bitcoin#18622

  A bug in WSL means that fcntl does not exclusively lock files, allowing multiple instances of bitcoin to use the same datadir. If we instead use flock, it works correctly. Passes Travis, but testing on some OS variety would be sensible.

  From what I can tell, flock and fcntl don't work with each other on linux, so it would still be possible to run a node with this code change and a node before it with the same datadir (this isn't true for Mac/FreeBSD). flock also doesn't support NFS on MacOS and linux<2.6.12 while fcntl did. See here for example: https://gavv.github.io/articles/file-locks/

  If changing to flock for all systems is inadvisable, it would also be possible to just detect WSL and use flock when on that platform to avoid the bug.

ACKs for top commit:
  laanwj:
    Code review ACK e8fa0a3

Tree-SHA512: ca1009e171970101f1dc2332c5e998717aee00eebc80bb586b826927a74bd0d4c94712e46d1396821bc30533d76deac391b6e1c406c406865661f57fa062c702
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 1, 2021
e8fa0a3 Fix WSL file locking by using flock instead of fcntl (Samuel Dobson)

Pull request description:

  Fixes bitcoin#18622

  A bug in WSL means that fcntl does not exclusively lock files, allowing multiple instances of bitcoin to use the same datadir. If we instead use flock, it works correctly. Passes Travis, but testing on some OS variety would be sensible.

  From what I can tell, flock and fcntl don't work with each other on linux, so it would still be possible to run a node with this code change and a node before it with the same datadir (this isn't true for Mac/FreeBSD). flock also doesn't support NFS on MacOS and linux<2.6.12 while fcntl did. See here for example: https://gavv.github.io/articles/file-locks/

  If changing to flock for all systems is inadvisable, it would also be possible to just detect WSL and use flock when on that platform to avoid the bug.

ACKs for top commit:
  laanwj:
    Code review ACK e8fa0a3

Tree-SHA512: ca1009e171970101f1dc2332c5e998717aee00eebc80bb586b826927a74bd0d4c94712e46d1396821bc30533d76deac391b6e1c406c406865661f57fa062c702
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 1, 2021
e8fa0a3 Fix WSL file locking by using flock instead of fcntl (Samuel Dobson)

Pull request description:

  Fixes bitcoin#18622

  A bug in WSL means that fcntl does not exclusively lock files, allowing multiple instances of bitcoin to use the same datadir. If we instead use flock, it works correctly. Passes Travis, but testing on some OS variety would be sensible.

  From what I can tell, flock and fcntl don't work with each other on linux, so it would still be possible to run a node with this code change and a node before it with the same datadir (this isn't true for Mac/FreeBSD). flock also doesn't support NFS on MacOS and linux<2.6.12 while fcntl did. See here for example: https://gavv.github.io/articles/file-locks/

  If changing to flock for all systems is inadvisable, it would also be possible to just detect WSL and use flock when on that platform to avoid the bug.

ACKs for top commit:
  laanwj:
    Code review ACK e8fa0a3

Tree-SHA512: ca1009e171970101f1dc2332c5e998717aee00eebc80bb586b826927a74bd0d4c94712e46d1396821bc30533d76deac391b6e1c406c406865661f57fa062c702
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 14, 2021
e8fa0a3 Fix WSL file locking by using flock instead of fcntl (Samuel Dobson)

Pull request description:

  Fixes bitcoin#18622

  A bug in WSL means that fcntl does not exclusively lock files, allowing multiple instances of bitcoin to use the same datadir. If we instead use flock, it works correctly. Passes Travis, but testing on some OS variety would be sensible.

  From what I can tell, flock and fcntl don't work with each other on linux, so it would still be possible to run a node with this code change and a node before it with the same datadir (this isn't true for Mac/FreeBSD). flock also doesn't support NFS on MacOS and linux<2.6.12 while fcntl did. See here for example: https://gavv.github.io/articles/file-locks/

  If changing to flock for all systems is inadvisable, it would also be possible to just detect WSL and use flock when on that platform to avoid the bug.

ACKs for top commit:
  laanwj:
    Code review ACK e8fa0a3

Tree-SHA512: ca1009e171970101f1dc2332c5e998717aee00eebc80bb586b826927a74bd0d4c94712e46d1396821bc30533d76deac391b6e1c406c406865661f57fa062c702
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 15, 2021
e8fa0a3 Fix WSL file locking by using flock instead of fcntl (Samuel Dobson)

Pull request description:

  Fixes bitcoin#18622

  A bug in WSL means that fcntl does not exclusively lock files, allowing multiple instances of bitcoin to use the same datadir. If we instead use flock, it works correctly. Passes Travis, but testing on some OS variety would be sensible.

  From what I can tell, flock and fcntl don't work with each other on linux, so it would still be possible to run a node with this code change and a node before it with the same datadir (this isn't true for Mac/FreeBSD). flock also doesn't support NFS on MacOS and linux<2.6.12 while fcntl did. See here for example: https://gavv.github.io/articles/file-locks/

  If changing to flock for all systems is inadvisable, it would also be possible to just detect WSL and use flock when on that platform to avoid the bug.

ACKs for top commit:
  laanwj:
    Code review ACK e8fa0a3

Tree-SHA512: ca1009e171970101f1dc2332c5e998717aee00eebc80bb586b826927a74bd0d4c94712e46d1396821bc30533d76deac391b6e1c406c406865661f57fa062c702
random-zebra added a commit to PIVX-Project/PIVX that referenced this pull request Aug 9, 2021
8c4b365 Fix WSL file locking by using flock instead of fcntl (Samuel Dobson)
189de2f Avoid redefine warning (Peter Bushnell)

Pull request description:

  Straight forward backport of bitcoin#15782 and bitcoin#18700 to address a bug in WSL1 environments that results in improper locking behavior; ie, a directory lock is not made exclusive as intended, thus resulting in multiple instances of the wallet/daemon being able to access the same datadir simultaneously instead of erroring out due to a locking conflict as intended.

  This is specific to WSL1 environments, as WSL2 (not yet fully supported/documented), standard linux, and macOS environments behave as intended.

ACKs for top commit:
  furszy:
    good, utACK 8c4b365
  random-zebra:
    utACK 8c4b365 and merging...

Tree-SHA512: 7ba7d054a858baae4df2ae6daa4d3ffc694bcff0b48958ba28b3203d6dc0d950d25596eb324dc3973b09a65a251946c29be035959b3da7ecf126f9110b7056d0
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple bitcoind instances can point to the same -walletdir on Windows
10 participants