Skip to content

Commit

Permalink
Merge pull request #79 from fabregas/fix_check_version
Browse files Browse the repository at this point in the history
fixed bug in client.check_version()
  • Loading branch information
tvoinarovskyi committed Nov 23, 2016
2 parents 48cd6f3 + 6440fac commit 2390cd2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions aiokafka/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,14 @@ def check_version(self, node_id=None):
# so we send metadata request and wait response
task = self._loop.create_task(conn.send(request))
yield from asyncio.wait([task], timeout=0.1, loop=self._loop)
yield from self.fetch_all_metadata()
try:
yield from self.fetch_all_metadata()
except asyncio.CancelledError:
# metadata request can be cancelled in case
# of invalid correlationIds order
pass
yield from task
except (KafkaError, asyncio.CancelledError):
except KafkaError:
continue
else:
return version
Expand Down

0 comments on commit 2390cd2

Please sign in to comment.