Skip to content

Commit

Permalink
Fix for rebalance Exception causing recovery to crash (#57)
Browse files Browse the repository at this point in the history
* Fix #51

* fix for crash on _commit due to rebalance
  • Loading branch information
patkivikram authored Dec 12, 2020
1 parent 326d091 commit 8d6758f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions faust/tables/recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
)

import opentracing
from kafka.errors import IllegalStateError
from mode import Service, get_logger
from mode.services import WaitArgT
from mode.utils.times import humanize_seconds, humanize_seconds_ago
Expand Down Expand Up @@ -508,6 +509,11 @@ async def _restart_recovery(self) -> None:
for _span in spans:
finish_span(_span, error=exc)
continue # another rebalance started
except IllegalStateError as exc:
self.log.dev("RAISED REBALANCE AGAIN")
for _span in spans:
finish_span(_span, error=exc)
continue # another rebalance started
except ServiceStopped as exc:
self.log.dev("RAISED SERVICE STOPPED")
for _span in spans:
Expand Down
3 changes: 0 additions & 3 deletions faust/transport/drivers/aiokafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,21 +526,18 @@ async def _commit(self, offsets: Mapping[TP, int]) -> bool:
return False
self.log.exception("Committing raised exception: %r", exc)
await self.crash(exc)
self.supervisor.wakeup()
return False
except IllegalStateError as exc:
self.log.exception(
"Got exception: %r\nCurrent assignment: %r", exc, self.assignment()
)
await self.crash(exc)
self.supervisor.wakeup()
return False
except Exception as exc:
self.log.exception(
"Got exception: %r\nCurrent assignment: %r", exc, self.assignment()
)
await self.crash(exc)
self.supervisor.wakeup()
return False
return True

Expand Down

0 comments on commit 8d6758f

Please sign in to comment.