Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
446ef589
Commit
446ef589
authored
10 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Add errback to all deferreds in transaction_queue
parent
cc3d3bab
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/federation/transaction_queue.py
+23
-14
23 additions, 14 deletions
synapse/federation/transaction_queue.py
with
23 additions
and
14 deletions
synapse/federation/transaction_queue.py
+
23
−
14
View file @
446ef589
...
...
@@ -90,14 +90,17 @@ class TransactionQueue(object):
(
pdu
,
deferred
,
order
)
)
def
eb
(
failure
):
def
chain
(
failure
):
if
not
deferred
.
called
:
deferred
.
errback
(
failure
)
else
:
logger
.
warn
(
"
Failed to send pdu
"
,
failure
.
value
)
def
log_failure
(
failure
):
logger
.
warn
(
"
Failed to send pdu
"
,
failure
.
value
)
deferred
.
addErrback
(
log_failure
)
with
PreserveLoggingContext
():
self
.
_attempt_new_transaction
(
destination
).
addErrback
(
eb
)
self
.
_attempt_new_transaction
(
destination
).
addErrback
(
chain
)
deferreds
.
append
(
deferred
)
...
...
@@ -115,14 +118,17 @@ class TransactionQueue(object):
(
edu
,
deferred
)
)
def
eb
(
failure
):
def
chain
(
failure
):
if
not
deferred
.
called
:
deferred
.
errback
(
failure
)
else
:
logger
.
warn
(
"
Failed to send edu
"
,
failure
.
value
)
def
log_failure
(
failure
):
logger
.
warn
(
"
Failed to send pdu
"
,
failure
.
value
)
deferred
.
addErrback
(
log_failure
)
with
PreserveLoggingContext
():
self
.
_attempt_new_transaction
(
destination
).
addErrback
(
eb
)
self
.
_attempt_new_transaction
(
destination
).
addErrback
(
chain
)
return
deferred
...
...
@@ -139,14 +145,17 @@ class TransactionQueue(object):
(
failure
,
deferred
)
)
def
eb
(
failure
):
def
chain
(
f
):
if
not
deferred
.
called
:
deferred
.
errback
(
failure
)
else
:
logger
.
warn
(
"
Failed to send failure
"
,
failure
.
value
)
deferred
.
errback
(
f
)
def
log_failure
(
f
):
logger
.
warn
(
"
Failed to send pdu
"
,
f
.
value
)
deferred
.
addErrback
(
log_failure
)
with
PreserveLoggingContext
():
self
.
_attempt_new_transaction
(
destination
).
addErrback
(
eb
)
self
.
_attempt_new_transaction
(
destination
).
addErrback
(
chain
)
yield
deferred
...
...
@@ -308,7 +317,7 @@ class TransactionQueue(object):
except
Exception
as
e
:
# We capture this here as there as nothing actually listens
# for this finishing functions deferred.
logger
.
exceptio
n
(
logger
.
war
n
(
"
TX [%s] Problem in _attempt_transaction: %s
"
,
destination
,
e
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment