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

Only copy local listeners when FF listener_records_in_ets is enabled #8984

Conversation

gomoripeti
Copy link
Contributor

Proposed Changes

The rabbit_listener_ets table normally only contains listener entries for the local node. However after upgrading to 3.11.x and the listener_records_in_ets feature flag is enabled, all entries were copied to ETS from Mnesia, and the replicated Mnesia table contained entries for all nodes in a multi-node cluster.

In this state rabbit_networking:listener_of_protocol_ets/1 could crash with a case clause when multiple rows match a protocol. This can happen for example when the node is put in maintenance and the web_stomp plugin is enabled which queries the ranch refs to close all client connections. (rabbit_web_stomp_listener:close_all_client_connections/1)

A simple restart of the node or app reinitializes the listeners and the ETS table so this "corrupt" state is cleared.

Only affects 3.11 series so opening the PR against that branch.

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)
  • Build system and/or CI

Checklist

Put an x in the boxes that apply.
You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally with my changes
  • If relevant, I have added necessary documentation to https://github.com/rabbitmq/rabbitmq-website
  • If relevant, I have added this change to the first version(s) in release-notes that I expect to introduce it

Further Comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc.

@michaelklishin michaelklishin added this to the 3.11.21 milestone Jul 31, 2023
@gomoripeti gomoripeti force-pushed the fix_listener_records_in_ets_enable branch from 3ccc729 to 01c3e88 Compare July 31, 2023 16:29
The `rabbit_listener_ets` table normally only contains listener entries
for the local node. However after upgrading to 3.11.x and the
`listener_records_in_ets` feature flag is enabled, all entries were
copied to ETS from Mnesia, and the replicated Mnesia table contained
entries for all nodes in a multi-node cluster.

In this state `rabbit_networking:listener_of_protocol_ets/1` could crash
with a case clause when multiple rows match a protocol. This can happen
for example when the node is put in maintenance and the web_stomp plugin
is enabled which queries the ranch refs to close all client connections.
(rabbit_web_stomp_listener:close_all_client_connections)/1)

A simple restart of the node or app reinitializes the listeners and the
ETS table so this "corrupt" state is cleared.
@gomoripeti gomoripeti force-pushed the fix_listener_records_in_ets_enable branch from 01c3e88 to 9c0025c Compare July 31, 2023 20:50
@michaelklishin
Copy link
Member

The failures seem unrelated. They had popped up after a Java dependency bump, so, something unrelated to any Erlang code.

We refactored these two suites in main and backported those changes to v3.12.x to avoid flakey parallel tests, so perhaps should do the same thing for v3.11.x.

@michaelklishin michaelklishin merged commit db005f7 into rabbitmq:v3.11.x Aug 1, 2023
@gomoripeti
Copy link
Contributor Author

thank you!

@gomoripeti gomoripeti deleted the fix_listener_records_in_ets_enable branch February 12, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants