Skip to content

Commit

Permalink
Handle setting results on Delays who'd protocol were never set
Browse files Browse the repository at this point in the history
Because races
  • Loading branch information
Jim Fulton committed Jul 9, 2016
1 parent 9ef630e commit ab158e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ZEO/asyncio/server.py
Expand Up @@ -165,12 +165,14 @@ def set_sender(self, msgid, protocol):

def reply(self, obj):
self.sent = 'reply'
self.protocol.send_reply(self.msgid, obj)
if self.protocol:
self.protocol.send_reply(self.msgid, obj)

def error(self, exc_info):
self.sent = 'error'
logger.error("Error raised in delayed method", exc_info=exc_info)
self.protocol.send_error(self.msgid, exc_info[1])
if self.protocol:
self.protocol.send_error(self.msgid, exc_info[1])

def __repr__(self):
return "%s[%s, %r, %r, %r]" % (
Expand Down

0 comments on commit ab158e8

Please sign in to comment.