Hopefully fixes #15733.
qa: Prevent concurrency issues reading .cookie file #15771
pull promag wants to merge 1 commits into bitcoin:master from promag:2019-04-retry-open-cookie changing 1 files +3 −1-
promag commented at 7:10 PM on April 8, 2019: member
- fanquake added the label Tests on Apr 8, 2019
-
in test/functional/test_framework/util.py:334 in 3709a699b7 outdated
335 | - userpass = f.read() 336 | - split_userpass = userpass.split(':') 337 | - user = split_userpass[0] 338 | - password = split_userpass[1] 339 | + cookie = os.path.join(datadir, "regtest", ".cookie") 340 | + wait_until(lambda: can_read_file(cookie), timeout=5)
MarcoFalke commented at 7:56 PM on April 8, 2019:I believe this method is not allowed to block, it must return a result immediately
Can be fixed by keeping the previous
if-logic
promag commented at 8:17 PM on April 8, 2019:I believe this method is not allowed to block, it must return a result immediately
Why not?
MarcoFalke commented at 8:21 PM on April 8, 2019:See
wait_for_rpc_connection, which calls this method
promag commented at 10:24 PM on April 8, 2019:Thanks,
wait_for_rpc_connectionalready retries so I've changed this remove the early checks and just try opening the cookie file.promag force-pushed on Apr 8, 2019promag renamed this:qa: Retry opening .cookie files
qa: Prevent concurrency issues reading .cookie file
on Apr 8, 2019MarcoFalke commented at 10:36 PM on April 8, 2019: memberutACK cc3bee31cc8eeeba7ab2e0f3d53b004d03fb1ab9
qa: Prevent concurrency issues reading .cookie file 90bce24576in test/functional/test_framework/util.py:332 in cc3bee31cc outdated
328 | with open(os.path.join(datadir, "regtest", ".cookie"), 'r', encoding="ascii") as f: 329 | userpass = f.read() 330 | split_userpass = userpass.split(':') 331 | user = split_userpass[0] 332 | password = split_userpass[1] 333 | + except FileNotFoundError:
MarcoFalke commented at 1:13 PM on April 9, 2019:except OSError:To also catch PermissionError, to not regress on 2753285be72dd051cf2987ca5c80d0b149914020?
See https://docs.python.org/3/library/exceptions.html#os-exceptions
promag commented at 1:28 PM on April 9, 2019:Done.
promag force-pushed on Apr 9, 2019MarcoFalke merged this on Apr 9, 2019MarcoFalke closed this on Apr 9, 2019MarcoFalke referenced this in commit f9f6c11a74 on Apr 9, 2019promag deleted the branch on Apr 22, 2019Munkybooty referenced this in commit 1d76cc7537 on Sep 30, 2021Munkybooty referenced this in commit 14b7de5618 on Oct 7, 2021Munkybooty referenced this in commit 13653ffc00 on Oct 12, 2021Munkybooty referenced this in commit 282dc46401 on Oct 16, 2021Munkybooty referenced this in commit 114462bbd0 on Oct 20, 2021Munkybooty referenced this in commit 30454896e6 on Oct 21, 2021Munkybooty referenced this in commit 42e655517c on Oct 23, 2021PastaPastaPasta referenced this in commit 7716ff4086 on Oct 24, 2021PastaPastaPasta referenced this in commit 5aebc257cc on Oct 25, 2021pravblockc referenced this in commit 767a7d2139 on Nov 18, 2021MarcoFalke locked this on Dec 16, 2021ContributorsLabels
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:14 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:14 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me