forked from MirrorHub/synapse
Merge pull request #3853 from matrix-org/erikj/log_outbound_each_time
Log outbound requests when we retry
This commit is contained in:
commit
fa0d464fa4
2 changed files with 73 additions and 73 deletions
1
changelog.d/3853.misc
Normal file
1
changelog.d/3853.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Log when we retry outbound requests
|
|
@ -177,11 +177,6 @@ class MatrixFederationHttpClient(object):
|
||||||
txn_id = "%s-O-%s" % (method, self._next_id)
|
txn_id = "%s-O-%s" % (method, self._next_id)
|
||||||
self._next_id = (self._next_id + 1) % (MAXINT - 1)
|
self._next_id = (self._next_id + 1) % (MAXINT - 1)
|
||||||
|
|
||||||
outbound_logger.info(
|
|
||||||
"{%s} [%s] Sending request: %s %s",
|
|
||||||
txn_id, destination, method, url
|
|
||||||
)
|
|
||||||
|
|
||||||
# XXX: Would be much nicer to retry only at the transaction-layer
|
# XXX: Would be much nicer to retry only at the transaction-layer
|
||||||
# (once we have reliable transactions in place)
|
# (once we have reliable transactions in place)
|
||||||
if long_retries:
|
if long_retries:
|
||||||
|
@ -194,7 +189,6 @@ class MatrixFederationHttpClient(object):
|
||||||
).decode('ascii')
|
).decode('ascii')
|
||||||
|
|
||||||
log_result = None
|
log_result = None
|
||||||
try:
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
if json_callback:
|
if json_callback:
|
||||||
|
@ -210,6 +204,11 @@ class MatrixFederationHttpClient(object):
|
||||||
data = None
|
data = None
|
||||||
self.sign_request(destination, method, http_url, headers_dict)
|
self.sign_request(destination, method, http_url, headers_dict)
|
||||||
|
|
||||||
|
outbound_logger.info(
|
||||||
|
"{%s} [%s] Sending request: %s %s",
|
||||||
|
txn_id, destination, method, url
|
||||||
|
)
|
||||||
|
|
||||||
request_deferred = treq.request(
|
request_deferred = treq.request(
|
||||||
method,
|
method,
|
||||||
url,
|
url,
|
||||||
|
|
Loading…
Reference in a new issue