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

Use new replication tcp API #351

Merged
merged 4 commits into from
Apr 5, 2017
Merged
Show file tree
Hide file tree
Changes from 3 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
72 changes: 44 additions & 28 deletions lib/SyTest/Homeserver/Synapse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,15 @@ sub generate_listeners
}
}

if( my $replication_tcp_port = $self->{ports}{synapse_replication_tcp} ) {
push @listeners, {
type => "replication",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to line these up nicely

port => $replication_tcp_port,
bind_address => $bind_host,
tls => 0,
}
}

return @listeners,
{
type => "metrics",
Expand Down Expand Up @@ -545,10 +554,11 @@ sub wrap_synapse_command

{
my $pusher_config_path = $self->write_yaml_file( "pusher.yaml" => {
"worker_app" => "synapse.app.pusher",
"worker_log_file" => "$log.pusher",
"worker_replication_url" => "http://$bind_host:$self->{ports}{synapse_unsecure}/_synapse/replication",
"worker_listeners" => [
"worker_app" => "synapse.app.pusher",
"worker_log_file" => "$log.pusher",
"worker_replication_host" => "$bind_host",
"worker_replication_port" => $self->{ports}{synapse_replication_tcp},
"worker_listeners" => [
{
type => "http",
resources => [{ names => ["metrics"] }],
Expand All @@ -568,10 +578,11 @@ sub wrap_synapse_command

{
my $appservice_config_path = $self->write_yaml_file( "appservice.yaml" => {
"worker_app" => "synapse.app.appservice",
"worker_log_file" => "$log.appservice",
"worker_replication_url" => "http://$bind_host:$self->{ports}{synapse_unsecure}/_synapse/replication",
"worker_listeners" => [
"worker_app" => "synapse.app.appservice",
"worker_log_file" => "$log.appservice",
"worker_replication_host" => "$bind_host",
"worker_replication_port" => $self->{ports}{synapse_replication_tcp},
"worker_listeners" => [
{
type => "manhole",
port => $self->{ports}{appservice_manhole},
Expand All @@ -591,10 +602,11 @@ sub wrap_synapse_command

{
my $federation_sender_config_path = $self->write_yaml_file( "federation_sender.yaml" => {
"worker_app" => "synapse.app.federation_sender",
"worker_log_file" => "$log.federation_sender",
"worker_replication_url" => "http://$bind_host:$self->{ports}{synapse_unsecure}/_synapse/replication",
"worker_listeners" => [
"worker_app" => "synapse.app.federation_sender",
"worker_log_file" => "$log.federation_sender",
"worker_replication_host" => "$bind_host",
"worker_replication_port" => $self->{ports}{synapse_replication_tcp},
"worker_listeners" => [
{
type => "manhole",
port => $self->{ports}{federation_sender_manhole},
Expand All @@ -614,10 +626,11 @@ sub wrap_synapse_command

{
my $synchrotron_config_path = $self->write_yaml_file( "synchrotron.yaml" => {
"worker_app" => "synapse.app.synchrotron",
"worker_log_file" => "$log.synchrotron",
"worker_replication_url" => "http://$bind_host:$self->{ports}{synapse_unsecure}/_synapse/replication",
"worker_listeners" => [
"worker_app" => "synapse.app.synchrotron",
"worker_log_file" => "$log.synchrotron",
"worker_replication_host" => "$bind_host",
"worker_replication_port" => $self->{ports}{synapse_replication_tcp},
"worker_listeners" => [
{
type => "http",
resources => [{ names => ["client"] }],
Expand Down Expand Up @@ -645,10 +658,11 @@ sub wrap_synapse_command

{
my $federation_reader_config_path = $self->write_yaml_file( "federation_reader.yaml" => {
"worker_app" => "synapse.app.federation_reader",
"worker_log_file" => "$log.federation_reader",
"worker_replication_url" => "http://$bind_host:$self->{ports}{synapse_unsecure}/_synapse/replication",
"worker_listeners" => [
"worker_app" => "synapse.app.federation_reader",
"worker_log_file" => "$log.federation_reader",
"worker_replication_host" => "$bind_host",
"worker_replication_port" => $self->{ports}{synapse_replication_tcp},
"worker_listeners" => [
{
type => "http",
resources => [{ names => ["federation"] }],
Expand Down Expand Up @@ -676,10 +690,11 @@ sub wrap_synapse_command

{
my $media_repository_config_path = $self->write_yaml_file( "media_repository.yaml" => {
"worker_app" => "synapse.app.media_repository",
"worker_log_file" => "$log.media_repository",
"worker_replication_url" => "http://$bind_host:$self->{ports}{synapse_unsecure}/_synapse/replication",
"worker_listeners" => [
"worker_app" => "synapse.app.media_repository",
"worker_log_file" => "$log.media_repository",
"worker_replication_host" => "$bind_host",
"worker_replication_port" => $self->{ports}{synapse_replication_tcp},
"worker_listeners" => [
{
type => "http",
resources => [{ names => ["media"] }],
Expand Down Expand Up @@ -707,10 +722,11 @@ sub wrap_synapse_command

{
my $client_reader_config_path = $self->write_yaml_file( "client_reader.yaml" => {
"worker_app" => "synapse.app.client_reader",
"worker_log_file" => "$log.client_reader",
"worker_replication_url" => "http://$bind_host:$self->{ports}{synapse_unsecure}/_synapse/replication",
"worker_listeners" => [
"worker_app" => "synapse.app.client_reader",
"worker_log_file" => "$log.client_reader",
"worker_replication_host" => "$bind_host",
"worker_replication_port" => $self->{ports}{synapse_replication_tcp},
"worker_listeners" => [
{
type => "http",
resources => [{ names => ["client"] }],
Expand Down
7 changes: 4 additions & 3 deletions tests/05synapse.pl
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ sub extract_extra_args
synapse_dir => $SYNAPSE_ARGS{directory},
hs_dir => abs_path( "server-$idx" ),
ports => {
synapse => main::alloc_port( "synapse[$idx]" ),
synapse_unsecure => main::alloc_port( "synapse[$idx].unsecure" ),
synapse_metrics => main::alloc_port( "synapse[$idx].metrics" ),
synapse => main::alloc_port( "synapse[$idx]" ),
synapse_unsecure => main::alloc_port( "synapse[$idx].unsecure" ),
synapse_metrics => main::alloc_port( "synapse[$idx].metrics" ),
synapse_replication_tcp => main::alloc_port( "synapse[$idx].replication_tcp" ),

pusher_metrics => main::alloc_port( "pusher[$idx].metrics" ),
pusher_manhole => main::alloc_port( "pusher[$idx].manhole" ),
Expand Down