File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ async def _run_loop(self) -> None:
8383 BaseException: If the actor's `_run()` method raises any base exception.
8484 """
8585 _logger .info ("Actor %s: Started." , self )
86- n_restarts = 0
86+ n_errors = 0
8787 should_delay = False
8888 while True :
8989 try :
@@ -102,10 +102,12 @@ async def _run_loop(self) -> None:
102102 should_delay = True
103103 _logger .exception ("Actor %s: Raised an unhandled exception." , self )
104104 limit_str = "∞" if self ._restart_limit is None else self ._restart_limit
105- limit_str = f"({ n_restarts } /{ limit_str } )"
106- if self ._restart_limit is None or n_restarts < self ._restart_limit :
107- n_restarts += 1
108- _logger .info ("Actor %s: Restarting %s..." , self , limit_str )
105+ limit_str = f"({ n_errors } /{ limit_str } )"
106+ if self ._restart_limit is None or n_errors < self ._restart_limit :
107+ n_errors += 1
108+ _logger .info (
109+ "Actor %s: Restarting, error count %s..." , self , limit_str
110+ )
109111 continue
110112 _logger .info (
111113 "Actor %s: Maximum restarts attempted %s, bailing out..." ,
Original file line number Diff line number Diff line change @@ -246,7 +246,8 @@ async def test_restart_on_unhandled_exception(
246246 ),
247247 (
248248 * ACTOR_INFO ,
249- f"Actor RaiseExceptionActor[test]: Restarting ({ i } /{ restart_limit } )..." ,
249+ "Actor RaiseExceptionActor[test]: "
250+ f"Restarting, error count ({ i } /{ restart_limit } )..." ,
250251 ),
251252 (
252253 * ACTOR_INFO ,
You can’t perform that action at this time.
0 commit comments