summary refs log tree commit diff
path: root/synapse/replication/http/_base.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-05-26 09:43:21 +0100
committerErik Johnston <erik@matrix.org>2020-05-26 09:43:21 +0100
commit8beca8e21f16e36b94fc79ff31702bb57e4a2f17 (patch)
treec837d22a8a02dc71581aa1207ecd19b95625b4bf /synapse/replication/http/_base.py
parentMerge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes (diff)
parentSimplify reap_monthly_active_users (#7558) (diff)
downloadsynapse-8beca8e21f16e36b94fc79ff31702bb57e4a2f17.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/replication/http/_base.py')
-rw-r--r--synapse/replication/http/_base.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/replication/http/_base.py b/synapse/replication/http/_base.py

index c3136a4eb9..793cef6c26 100644 --- a/synapse/replication/http/_base.py +++ b/synapse/replication/http/_base.py
@@ -142,6 +142,7 @@ class ReplicationEndpoint(object): """ clock = hs.get_clock() client = hs.get_simple_http_client() + local_instance_name = hs.get_instance_name() master_host = hs.config.worker_replication_host master_port = hs.config.worker_replication_http_port @@ -151,6 +152,8 @@ class ReplicationEndpoint(object): @trace(opname="outgoing_replication_request") @defer.inlineCallbacks def send_request(instance_name="master", **kwargs): + if instance_name == local_instance_name: + raise Exception("Trying to send HTTP request to self") if instance_name == "master": host = master_host port = master_port