mirror of
https://github.com/element-hq/synapse
synced 2024-08-19 23:10:20 +00:00
E2E key query: handle federation fails
Don't fail the whole request if we can't connect to a particular server.
This commit is contained in:
parent
0d81e26769
commit
efa4ccfaee
1 changed files with 11 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
||||||
import ujson as json
|
import ujson as json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
import twisted.internet.error
|
||||||
from canonicaljson import encode_canonical_json
|
from canonicaljson import encode_canonical_json
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
|
@ -111,6 +112,11 @@ class E2eKeysHandler(object):
|
||||||
failures[destination] = {
|
failures[destination] = {
|
||||||
"status": 503, "message": "Not ready for retry",
|
"status": 503, "message": "Not ready for retry",
|
||||||
}
|
}
|
||||||
|
except Exception as e:
|
||||||
|
# include ConnectionRefused and other errors
|
||||||
|
failures[destination] = {
|
||||||
|
"status": 503, "message": e.message
|
||||||
|
}
|
||||||
|
|
||||||
yield preserve_context_over_deferred(defer.gatherResults([
|
yield preserve_context_over_deferred(defer.gatherResults([
|
||||||
preserve_fn(do_remote_query)(destination)
|
preserve_fn(do_remote_query)(destination)
|
||||||
|
@ -222,6 +228,11 @@ class E2eKeysHandler(object):
|
||||||
failures[destination] = {
|
failures[destination] = {
|
||||||
"status": 503, "message": "Not ready for retry",
|
"status": 503, "message": "Not ready for retry",
|
||||||
}
|
}
|
||||||
|
except Exception as e:
|
||||||
|
# include ConnectionRefused and other errors
|
||||||
|
failures[destination] = {
|
||||||
|
"status": 503, "message": e.message
|
||||||
|
}
|
||||||
|
|
||||||
yield preserve_context_over_deferred(defer.gatherResults([
|
yield preserve_context_over_deferred(defer.gatherResults([
|
||||||
preserve_fn(claim_client_keys)(destination)
|
preserve_fn(claim_client_keys)(destination)
|
||||||
|
|
Loading…
Reference in a new issue