Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qa: Remove race between connecting and shutdown on separate connections #14958

Merged
merged 1 commit into from Jan 16, 2019

Conversation

@promag
Copy link
Member

@promag promag commented Dec 14, 2018

Fixes the error #14670 (comment) reported by @ken2812221.

There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command waitfornewblock running before calling stop.

See also #14670 (comment).

@promag promag force-pushed the 2018-12-improve-shutdown-test branch from 410ce75 to 406204f Dec 14, 2018
@fanquake fanquake added the Tests label Dec 14, 2018
@promag promag force-pushed the 2018-12-improve-shutdown-test branch from 406204f to e2b0fec Dec 14, 2018
test/functional/feature_shutdown.py Outdated Show resolved Hide resolved
@promag promag force-pushed the 2018-12-improve-shutdown-test branch 2 times, most recently from b3f27ea to eeb8e04 Dec 14, 2018
src/rpc/server.cpp Outdated Show resolved Hide resolved
@promag promag force-pushed the 2018-12-improve-shutdown-test branch from eeb8e04 to 9be0dce Jan 2, 2019
laanwj added a commit that referenced this issue Jan 14, 2019
a0ac154 doc: Add getrpcinfo release notes (João Barbosa)
251a91c qa: Add tests for getrpcinfo (João Barbosa)
d0730f5 rpc: Add getrpcinfo command (João Barbosa)
068a8fc rpc: Track active commands (João Barbosa)
bf43832 rpc: Remove unused PreCommand signal (João Barbosa)

Pull request description:

  The new `getrpcinfo` command exposes details of the RPC interface. The details can be configuration properties or runtime values/stats.

  This can be particular useful to coordinate concurrent functional tests (see #14958 from where this was extracted).

Tree-SHA512: 7292cb6087f4c429973d991aa2b53ffa1327d5a213df7d6ba5fc69b01b2e1a411f6d1609fed9234896293317dab05f65064da48b8f2b4a998eba532591d31882
@promag promag force-pushed the 2018-12-improve-shutdown-test branch from 9be0dce to 49a79d4 Jan 15, 2019
@@ -20,8 +20,14 @@ def set_test_params(self):

def run_test(self):
node = get_rpc_proxy(self.nodes[0].url, 1, timeout=600, coveragedir=self.nodes[0].coverage_dir)
# Force connection establishment by executing a dummy command.
node.getblockcount()
Copy link
Member

@MarcoFalke MarcoFalke Jan 15, 2019

Is this required given that we wait anyway until node.waitfornewblock is called, which in turn should set up the connection?

Copy link
Member Author

@promag promag Jan 15, 2019

For the test to pass this is not required, but this is here to note that there's still a race after connection establishment. Let me know if it's not important.

@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke commented Jan 15, 2019

utACK 49a79d454284df7758f83ccd3121afb3e6799342

@promag promag changed the title qa: Remove race between conneting and shutdown on separate connections qa: Remove race between connecting and shutdown on separate connections Jan 16, 2019
@promag promag force-pushed the 2018-12-improve-shutdown-test branch from 49a79d4 to 4412a59 Jan 16, 2019
@laanwj
Copy link
Member

@laanwj laanwj commented Jan 16, 2019

utACK 4412a59
No difference with 49a79d4 except for commit msg.

@laanwj laanwj merged commit 4412a59 into bitcoin:master Jan 16, 2019
0 of 2 checks passed
laanwj added a commit that referenced this issue Jan 16, 2019
…rate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error #14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also #14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
@promag promag deleted the 2018-12-improve-shutdown-test branch Jan 16, 2019
scravy added a commit to dtr-org/unit-e that referenced this issue Feb 28, 2019
Ignore disconnects when stopping node - fixes #367
This is a port of bitcoin/bitcoin#14670

This problem is related to the "stop" RPC call.
It turns out that sometimes the node stops before it sends the response.
That causes the client to retry the call and lead to "ConnectionRefusedError".

I found out that there is a fix in bitcoin repo (in master branch, actually), related to this bug.
In the nutshell, this changes removes forced exit of libevent loop, which allows
to process all the requests gracefully.

Test feature_shutdown.py wasn't ported because it introduces a bug bitcoin/bitcoin#14670 (comment)
The "improvement" bitcoin/bitcoin#14958 requires RPC method "getrpcinfo" which isn't ported from the bitcoin codebase yet.

There are other floating tests with a similar error (ConnectionRefusedError):
fixes #373
fixes #484
fixes #544

Signed-off-by: Dmitry Saveliev <dima@thirdhash.com>
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 26, 2021
…on separate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error bitcoin#14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also bitcoin#14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 27, 2021
…on separate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error bitcoin#14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also bitcoin#14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 28, 2021
…on separate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error bitcoin#14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also bitcoin#14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 29, 2021
…on separate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error bitcoin#14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also bitcoin#14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jul 1, 2021
…on separate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error bitcoin#14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also bitcoin#14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jul 1, 2021
…on separate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error bitcoin#14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also bitcoin#14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
pravblockc added a commit to pravblockc/dash that referenced this issue Aug 10, 2021
a0ac154 doc: Add getrpcinfo release notes (João Barbosa)
251a91c qa: Add tests for getrpcinfo (João Barbosa)
d0730f5 rpc: Add getrpcinfo command (João Barbosa)
068a8fc rpc: Track active commands (João Barbosa)
bf43832 rpc: Remove unused PreCommand signal (João Barbosa)

Pull request description:

  The new `getrpcinfo` command exposes details of the RPC interface. The details can be configuration properties or runtime values/stats.

  This can be particular useful to coordinate concurrent functional tests (see bitcoin#14958 from where this was extracted).

Tree-SHA512: 7292cb6087f4c429973d991aa2b53ffa1327d5a213df7d6ba5fc69b01b2e1a411f6d1609fed9234896293317dab05f65064da48b8f2b4a998eba532591d31882
pravblockc added a commit to pravblockc/dash that referenced this issue Aug 10, 2021
a0ac154 doc: Add getrpcinfo release notes (João Barbosa)
251a91c qa: Add tests for getrpcinfo (João Barbosa)
d0730f5 rpc: Add getrpcinfo command (João Barbosa)
068a8fc rpc: Track active commands (João Barbosa)
bf43832 rpc: Remove unused PreCommand signal (João Barbosa)

Pull request description:

  The new `getrpcinfo` command exposes details of the RPC interface. The details can be configuration properties or runtime values/stats.

  This can be particular useful to coordinate concurrent functional tests (see bitcoin#14958 from where this was extracted).

Tree-SHA512: 7292cb6087f4c429973d991aa2b53ffa1327d5a213df7d6ba5fc69b01b2e1a411f6d1609fed9234896293317dab05f65064da48b8f2b4a998eba532591d31882
pravblockc added a commit to pravblockc/dash that referenced this issue Aug 14, 2021
a0ac154 doc: Add getrpcinfo release notes (João Barbosa)
251a91c qa: Add tests for getrpcinfo (João Barbosa)
d0730f5 rpc: Add getrpcinfo command (João Barbosa)
068a8fc rpc: Track active commands (João Barbosa)
bf43832 rpc: Remove unused PreCommand signal (João Barbosa)

Pull request description:

  The new `getrpcinfo` command exposes details of the RPC interface. The details can be configuration properties or runtime values/stats.

  This can be particular useful to coordinate concurrent functional tests (see bitcoin#14958 from where this was extracted).

Tree-SHA512: 7292cb6087f4c429973d991aa2b53ffa1327d5a213df7d6ba5fc69b01b2e1a411f6d1609fed9234896293317dab05f65064da48b8f2b4a998eba532591d31882
vijaydasmp added a commit to vijaydasmp/dash that referenced this issue Sep 12, 2021
…on separate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error bitcoin#14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also bitcoin#14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
vijaydasmp added a commit to vijaydasmp/dash that referenced this issue Sep 12, 2021
…on separate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error bitcoin#14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also bitcoin#14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
vijaydasmp added a commit to vijaydasmp/dash that referenced this issue Sep 12, 2021
…on separate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error bitcoin#14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also bitcoin#14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
vijaydasmp added a commit to vijaydasmp/dash that referenced this issue Sep 12, 2021
…on separate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error bitcoin#14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also bitcoin#14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
vijaydasmp added a commit to vijaydasmp/dash that referenced this issue Sep 12, 2021
…on separate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error bitcoin#14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also bitcoin#14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
vijaydasmp added a commit to vijaydasmp/dash that referenced this issue Sep 13, 2021
…on separate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error bitcoin#14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also bitcoin#14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
vijaydasmp added a commit to vijaydasmp/dash that referenced this issue Sep 13, 2021
…on separate connections

4412a59 qa: Remove race between connecting and shutdown on separate connections (João Barbosa)

Pull request description:

  Fixes the error bitcoin#14670 (comment) reported by @ken2812221.

  There is a race between RPC stop and another concurrent call in the test framework. The connection must be established and the command `waitfornewblock` running before calling `stop`.

  See also bitcoin#14670 (comment).

Tree-SHA512: 77feb8628d3b9c025ec0cf83565d4d6680cad4fb182fc93a65df8b573f3e799ba4c44e06d9001dd8a375ca0b1ee17f10e66c3902b6256d0ae2acbc64539185d7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants