Skip to content

Conversation

@ken2812221
Copy link
Contributor

@ken2812221 ken2812221 commented Oct 6, 2018

The rpc handler may be unregistered when http server haven't been closed yet. So it may be allowable to get -342 non-JSON HTTP response with \'%i %s\' from server (503 Service Unavailable)

See https://ci.appveyor.com/project/DrahtBot/bitcoin/build/master.2001. It shows "Rejecting request while shutting down" between "RPC stopped" and "Stopped HTTP server"

@fanquake fanquake added the Tests label Oct 6, 2018
@practicalswift
Copy link
Contributor

Concept ACK

I've seen this in AppVeyor. Thanks for addressing!

@ryanofsky
Copy link
Contributor

Code change seems reasonable, but I don't understand the issue.

What would cause the RPC handler to become unregistered while the test framework is in wait_for_rpc_connection? Why would the nodes be getting shut down if the test framework isn't shutting them down?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe just pass this on as well? This way we'd make sure to always have an exit code as opposed to randomly this message or an exit code due to the racyness.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, fixed

@maflcko
Copy link
Member

maflcko commented Oct 8, 2018

@ryanofsky If the node can't initialize itself shuts down itself without having the test framework shut it down.

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

@ryanofsky If the node can't initialize itself shuts down itself without having the test framework shut it down.

Thanks. I didn't realize assert_start_raises_init_error would wait for RPCs to be ready. But I guess it needs to in order to call shut down the node when the error doesn't trigger.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this comment is confusing without mentioning why the server is shutting down. Maybe change it to something like:

# Service unavailable, RPC server started but is shutting down due to error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment added

Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be good to call self.process.wait() here and include the exit code in the exception, so this is more similar to the previous FailedToStartError exception above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would prefer @MarcoFalke's method, then we don't have to raise it here again.

@maflcko
Copy link
Member

maflcko commented Oct 8, 2018

utACK 62c304e

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

utACK 62c304e

maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Oct 8, 2018
…raises_init_error

62c304e tests: Allow closed http server in assert_start_raises_init_error (Chun Kuan Lee)

Pull request description:

  The rpc handler may be unregistered when http server haven't been closed yet. So it may be allowable to get -342 `non-JSON HTTP response with \'%i %s\' from server` (503 Service Unavailable)

  See https://ci.appveyor.com/project/DrahtBot/bitcoin/build/master.2001. It shows "Rejecting request while shutting down" between "RPC stopped" and "Stopped HTTP server"

Tree-SHA512: e1f50ab9096cf23494ccc2850c01516c4a75f112c99108759157b22fce2011682a4b88216f206702f6a56e960182c00098053ad75f13aa0eafe27046adae63da
@maflcko maflcko merged commit 62c304e into bitcoin:master Oct 8, 2018
@ken2812221 ken2812221 deleted the test-uacomment-log branch October 8, 2018 04:32
codablock pushed a commit to codablock/dash that referenced this pull request Oct 16, 2019
…raises_init_error

62c304e tests: Allow closed http server in assert_start_raises_init_error (Chun Kuan Lee)

Pull request description:

  The rpc handler may be unregistered when http server haven't been closed yet. So it may be allowable to get -342 `non-JSON HTTP response with \'%i %s\' from server` (503 Service Unavailable)

  See https://ci.appveyor.com/project/DrahtBot/bitcoin/build/master.2001. It shows "Rejecting request while shutting down" between "RPC stopped" and "Stopped HTTP server"

Tree-SHA512: e1f50ab9096cf23494ccc2850c01516c4a75f112c99108759157b22fce2011682a4b88216f206702f6a56e960182c00098053ad75f13aa0eafe27046adae63da
codablock added a commit to dashpay/dash that referenced this pull request Oct 17, 2019
…raises_init_error (#3157)

62c304e tests: Allow closed http server in assert_start_raises_init_error (Chun Kuan Lee)

Pull request description:

  The rpc handler may be unregistered when http server haven't been closed yet. So it may be allowable to get -342 `non-JSON HTTP response with \'%i %s\' from server` (503 Service Unavailable)

  See https://ci.appveyor.com/project/DrahtBot/bitcoin/build/master.2001. It shows "Rejecting request while shutting down" between "RPC stopped" and "Stopped HTTP server"

Tree-SHA512: e1f50ab9096cf23494ccc2850c01516c4a75f112c99108759157b22fce2011682a4b88216f206702f6a56e960182c00098053ad75f13aa0eafe27046adae63da
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants