Skip to content

Commit

Permalink
add wait log
Browse files Browse the repository at this point in the history
  • Loading branch information
hirosassa committed Jan 16, 2021
1 parent 715ed32 commit 8f36797
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions luigi/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def retry_logging(retry_state):
if self._rpc_log_retries:
logger.warning("Failed connecting to remote scheduler %r", self._url, exc_info=True)
logger.info("Retrying attempt %r of %r (max)" % (retry_state.attempt_number, self._rpc_retry_attempts))
logger.info("Wait for %d seconds" % self._rpc_retry_wait)

return Retrying(wait=wait_fixed(self._rpc_retry_wait),
stop=stop_after_attempt(self._rpc_retry_attempts),
Expand Down
2 changes: 2 additions & 0 deletions test/rpc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ def test_log_rpc_retries_enabled(self, mock_logger):
self.assertEqual([
mock.call.warning('Failed connecting to remote scheduler %r', 'http://zorg.com', exc_info=True),
mock.call.info('Retrying attempt 1 of 3 (max)'),
mock.call.info('Wait for 1 seconds'),
mock.call.warning('Failed connecting to remote scheduler %r', 'http://zorg.com', exc_info=True),
mock.call.info('Retrying attempt 2 of 3 (max)'),
mock.call.info('Wait for 1 seconds'),
], mock_logger.mock_calls)

@with_config({'core': {'rpc-log-retries': 'false'}})
Expand Down

0 comments on commit 8f36797

Please sign in to comment.