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

Test that handling to device messages off master works #1001

Merged
merged 3 commits into from
Jan 7, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions lib/SyTest/Homeserver/Synapse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,15 @@ sub start
host => "$bind_host",
port => $self->{ports}{event_persister2},
},
"client_reader" => {
erikjohnston marked this conversation as resolved.
Show resolved Hide resolved
host => "$bind_host",
port => $self->{ports}{client_reader},
},
},

stream_writers => {
events => $self->{redis_host} ne '' ? [ "event_persister1", "event_persister2" ] : "master",
to_device => $self->{redis_host} ne '' ? [ "client_reader" ] : "master",
erikjohnston marked this conversation as resolved.
Show resolved Hide resolved
erikjohnston marked this conversation as resolved.
Show resolved Hide resolved
},

# We use a high limit so the limit is never reached, but enabling the
Expand Down Expand Up @@ -847,7 +852,7 @@ sub _start_synapse
"worker_listeners" => [
{
type => "http",
resources => [{ names => ["client"] }],
resources => [{ names => ["client", "replication"] }],
port => $self->{ports}{client_reader},
bind_address => $bind_host,
},
Expand Down Expand Up @@ -1189,7 +1194,12 @@ EOCONFIG

sub generate_haproxy_map
{
return <<'EOCONFIG';
my $self = shift;

# The base haproxy routes. Note that we add more routes below if using
# haproxy. Also, the routing for GET requests below takes precedence over
# these routes.
my $haproxy_map = <<'EOCONFIG';
^/_matrix/client/(v2_alpha|r0)/sync$ synchrotron
^/_matrix/client/(api/v1|v2_alpha|r0)/events$ synchrotron
^/_matrix/client/(api/v1|r0)/initialSync$ synchrotron
Expand Down Expand Up @@ -1247,6 +1257,17 @@ sub generate_haproxy_map
^/_matrix/client/(api/v1|r0|unstable)/profile/ event_creator

EOCONFIG

# Some things can only be moved off master when using redis.
if ( $self->{redis_host} ne '' ) {
$haproxy_map .= <<'EOCONFIG';

^/_matrix/client/(api/v1|r0|unstable)/sendToDevice/ client_reader

EOCONFIG
}

return $haproxy_map
}

sub generate_haproxy_get_map
Expand Down