Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Triggering event using pusher does not work consistently when using replication #777

Closed
@mdprotacio

Description

@mdprotacio

We have been trying to use replication using async-redis driver on multiple ec2 instances and served through application load balancer and using CloudFront.

We have some backend services that triggers some event notifications using pusher-php-server which does not subscribe to channel but instead just trigger an event on the channel.

The problem appears to be on how the message is propagated across servers. For instance, the enduser subscribes on server1 and thus registers the channel on the LocalChannelManager but does not register the same channel on server2. The backend service now triggers an event on server2. However, since the LocalChannelManager instance does not have the channel on server2, the call to broadcastToEveryoneExcept on PusherClientMessage class will not succeed as channel is not defined in that server2.

As a workaround, we have overriden the find method of RedisChannelManager to return an instance of channel by updating the local property as if the channel is registered when not present.

Despite of doing that workaround, it doesn't appear to be working well consistently until we use sticky sessions on target group. It appears that the implementation of pubsub should be reviewed/redesigned to ensure that the message is sent across all instances regardless of where the request is received.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions