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

Have frontend proxy persist events when using redis #870

Merged
merged 11 commits into from
Jun 2, 2020
19 changes: 16 additions & 3 deletions lib/SyTest/Homeserver/Synapse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,27 @@ sub start
},
) : (),

instance_map => {
"frontend_proxy1" => {
host => "$bind_host",
port => $self->{ports}{frontend_proxy},
},
},

stream_writers => {
events => $self->{redis_host} ne '' ? "frontend_proxy1" : "master",
},

# We use a high limit so the limit is never reached, but enabling the
# limit ensures that the code paths get hit. This helps testing the
# feature with worker mode.
limit_usage_by_mau => "true",
max_mau_value => 50000000,

redis => {
enabled => $self->{redis_host} ne '',
host => $self->{redis_host},
enabled => $self->{redis_host} ne '',
password => "foobar",
host => $self->{redis_host},
},

map {
Expand Down Expand Up @@ -988,6 +1000,7 @@ sub wrap_synapse_command
{
my $frontend_proxy_config_path = $self->write_yaml_file( "frontend_proxy.yaml" => {
"worker_app" => "synapse.app.frontend_proxy",
"worker_name" => "frontend_proxy1",
"worker_pid_file" => "$hsdir/frontend_proxy.pid",
"worker_log_config" => $self->configure_logger("frontend_proxy"),
"worker_replication_host" => "$bind_host",
Expand All @@ -997,7 +1010,7 @@ sub wrap_synapse_command
"worker_listeners" => [
{
type => "http",
resources => [{ names => ["client"] }],
resources => [{ names => ["client", "replication"] }],
port => $self->{ports}{frontend_proxy},
bind_address => $bind_host,
},
Expand Down