-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Close connections when vhost is unavailable (supervision tree is down) #1293
Merged
kjnilsson
merged 8 commits into
master
from
rabbitmq-server-close-connection-on-vhost-down
Jul 25, 2017
Merged
Close connections when vhost is unavailable (supervision tree is down) #1293
kjnilsson
merged 8 commits into
master
from
rabbitmq-server-close-connection-on-vhost-down
Jul 25, 2017
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
michaelklishin
changed the title
Close connections when vhost is down
Close connections when vhost is unavailable (supervision tree is down)
Jul 18, 2017
hairyhum
force-pushed
the
rabbitmq-server-close-connection-on-vhost-down
branch
from
July 19, 2017 09:07
23366e8
to
9138a48
Compare
In order to be aware if vhost is alive or not, introduce a rabbit_vhost_process gen_server, which manages recovery and teardown of a vhost. Also aliveness of the process can be used to determine a vhost state. Vhost process termination emits an event to close all the vhost connections. Addresses [#145106713]
If a vhost supervision tree is not active, which can be a result of an error in message store, refuse connections to this vhost on the node. This is a follow-up to [#140841611] [#1158] [#145106713]
Move non-limit tests from vhost limits suite to vhost suite. Add tests for connection closure and refuse when vhost supervisor is down. [#145106713]
hairyhum
force-pushed
the
rabbitmq-server-close-connection-on-vhost-down
branch
from
July 19, 2017 09:07
9138a48
to
049c902
Compare
When a node is starting or restarting it can fail to recover a vhost. The `continue` vhost recovery strategy means that vhosts can ba down if cannot be recovered. This behaviour should also work for node startup and it should skip failing vhosts.
dcorbacho
approved these changes
Jul 24, 2017
kjnilsson
approved these changes
Jul 25, 2017
|
||
%% The process will also check periodically if the vhost still | ||
%% present in mnesia DB and stop the vhost supervision tree when it | ||
%% desapears. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelling
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow up to #1158
When vhost is down, we close all the connections to the vhost on the node.
When a client tries to connect to the vhost on the node - connection is refused with
internal_error
.There are changes in supervision tree, which makes sure that vhost restarts are performed in order without concurrent message store processes running on the same vhosts.
Recovery is performed in the
vhost_process
process, which is formervhost_sup_watcher
.On termination the vhost process will notify that vhost is down, so the vhost connections can be closed.
A vhost "aliveness" status can be checked by checking aliveness of the vhost process.