Skip to content

Support Action Cable on GCP Memorystore

Heinrich Lee Yu requested to merge actioncable-gcp-memorystore into master

What does this MR do and why?

This patches Action Cable so that an id that is explicitly set to nil in cable.yml is not overwritten.

A nil id is needed so that the Redis client does not call CLIENT SETNAME which is not supported in GCP Memorystore.

Action Cable was enabled by default in 14.5 so this affects all instances using GCP Memorystore.

Related to #346421 (closed)

How to set up and validate locally

  1. Add id: to cable.yml

  2. In the Rails console run: ActionCable.server.pubsub.send(:redis_connection)

    Before this patch, it should show: #<Redis client v4.4.0 for ActionCable-PID-1626>.

    With this patch, it will show: #<Redis client v4.4.0 for redis://redis:6379/0>

Alternatively, you can try to actually send a Redis command via: ActionCable.server.pubsub.send(:redis_connection).get('test').

And then you can connect to the Redis console and run CLIENT LIST.

Before:

id=496 addr=172.18.0.10:43018 laddr=172.18.0.7:6379 fd=11 name=ActionCable-PID-1700 age=6 idle=6 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 argv-mem=0 obl=0 oll=0 omem=0 tot-mem=20504 events=r cmd=get user=default redir=-1

After:

id=499 addr=172.18.0.10:43034 laddr=172.18.0.7:6379 fd=11 name= age=3 idle=3 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 argv-mem=0 obl=0 oll=0 omem=0 tot-mem=20504 events=r cmd=get user=default redir=-1

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Heinrich Lee Yu

Merge request reports