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

Add channel_prefix support to AC redis/evented_redis adapters #27425

Merged
merged 1 commit into from Jan 18, 2017

Conversation

Projects
None yet
5 participants
@matrix9180
Contributor

matrix9180 commented Dec 21, 2016

Summary

#27224

In Redis, Pub/Sub has no relation to the key space. It was made to not interfere with it on any level, including database numbers.
Publishing on db 10, will be heard by a subscriber on db 1.
(https://redis.io/topics/pubsub#database-amp-scoping)

To avoid problems when multiple Rails applications use the same Redis instance, the redis/evented_redis subscription adapters now support a channel_prefix option (specified in cable.yml)

Other backends do not appear to have this issue.

The generated cable.yml has also been updated to reflect this change.

@rails-bot

This comment has been minimized.

Show comment
Hide comment
@rails-bot

rails-bot Dec 21, 2016

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.

Please see the contribution instructions for more information.

rails-bot commented Dec 21, 2016

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.

Please see the contribution instructions for more information.

@matrix9180

This comment has been minimized.

Show comment
Hide comment
@matrix9180
Contributor

matrix9180 commented Dec 21, 2016

@matrix9180 matrix9180 changed the title from #27224 Add channel_prefix support to AC redis/evented_redis adapters to Add channel_prefix support to AC redis/evented_redis adapters Dec 24, 2016

@rafaelfranca

Thank you for the pull request. It makes sense to me. I made some minor comments in the files.

Show outdated Hide outdated actioncable/lib/action_cable/subscription_adapter/naming.rb
Show outdated Hide outdated actioncable/lib/action_cable/subscription_adapter/evented_redis.rb
Show outdated Hide outdated actioncable/lib/action_cable/subscription_adapter/redis.rb

@rafaelfranca rafaelfranca requested a review from matthewd Dec 29, 2016

Show outdated Hide outdated actioncable/test/subscription_adapter/redis_test.rb
Show outdated Hide outdated railties/lib/rails/generators/rails/app/templates/config/cable.yml
Show outdated Hide outdated actioncable/lib/action_cable/subscription_adapter/redis.rb
Show outdated Hide outdated actioncable/lib/action_cable/subscription_adapter/naming.rb
@matrix9180

This comment has been minimized.

Show comment
Hide comment
@matrix9180

matrix9180 Jan 12, 2017

Contributor

Github didn't send me any notices about the comments here. Will make the requested changes.

Contributor

matrix9180 commented Jan 12, 2017

Github didn't send me any notices about the comments here. Will make the requested changes.

@matrix9180

This comment has been minimized.

Show comment
Hide comment
@matrix9180

matrix9180 Jan 13, 2017

Contributor

I believe I addressed everything here except documentation updates, but I'm not sure where those would go as documentation on configuring actioncable is rather sparse at the moment.

Contributor

matrix9180 commented Jan 13, 2017

I believe I addressed everything here except documentation updates, but I'm not sure where those would go as documentation on configuring actioncable is rather sparse at the moment.

@matrix9180

This comment has been minimized.

Show comment
Hide comment
@matrix9180
Contributor

matrix9180 commented Jan 14, 2017

@matrix9180

This comment has been minimized.

Show comment
Hide comment
@matrix9180

matrix9180 Jan 17, 2017

Contributor

Added some documentation on SubscriptionAdapter configuration to the ActionCable Overview guide. Not sure if it's in-scope for this PR or not.

Contributor

matrix9180 commented Jan 17, 2017

Added some documentation on SubscriptionAdapter configuration to the ActionCable Overview guide. Not sure if it's in-scope for this PR or not.

@rafaelfranca

Could you squash your first 6 commits in one?

@matrix9180

This comment has been minimized.

Show comment
Hide comment
@matrix9180

matrix9180 Jan 18, 2017

Contributor
Contributor

matrix9180 commented Jan 18, 2017

@matrix9180

This comment has been minimized.

Show comment
Hide comment
@matrix9180

matrix9180 Jan 18, 2017

Contributor

Rebased & squashed. Shall I open a separate PR for the documentation updates?

Contributor

matrix9180 commented Jan 18, 2017

Rebased & squashed. Shall I open a separate PR for the documentation updates?

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca Jan 18, 2017

Member

It was fine in a separated commit here but since you pulled it off a separate PR would be better

Member

rafaelfranca commented Jan 18, 2017

It was fine in a separated commit here but since you pulled it off a separate PR would be better

@matrix9180

This comment has been minimized.

Show comment
Hide comment
@matrix9180

matrix9180 Jan 18, 2017

Contributor

#27719 has the docs updates

Contributor

matrix9180 commented Jan 18, 2017

#27719 has the docs updates

@matrix9180

This comment has been minimized.

Show comment
Hide comment
@matrix9180

matrix9180 Jan 18, 2017

Contributor

Noticed the build failed on 2.3.3. Transient error? Couldn't reproduce it locally.

Contributor

matrix9180 commented Jan 18, 2017

Noticed the build failed on 2.3.3. Transient error? Couldn't reproduce it locally.

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca Jan 18, 2017

Member

It should be fine now

Member

rafaelfranca commented Jan 18, 2017

It should be fine now

@rafaelfranca rafaelfranca merged commit 0196704 into rails:master Jan 18, 2017

2 checks passed

codeclimate no new or fixed issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@matrix9180 matrix9180 deleted the matrix9180:action_cable_channel_prefix branch Jan 21, 2017

matrix9180 added a commit to matrix9180/rails that referenced this pull request Jan 22, 2017

eileencodes added a commit that referenced this pull request Jan 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment