Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Change O to 0 in TEST_simulate_retryable_error and add traceback #74

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/simple_worker/workers/test_worker.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def fail_three_times() -> None:
Raises an exception on the first three executions and succeeds on the fourth.
"""
env_var_name: str = f'{self.__class__.__name__}_attempt_count'
attempt_count: int = int(os.getenv(env_var_name, 'O'))
attempt_count: int = int(os.getenv(env_var_name, '0'))

try:
if attempt_count < 3: # noqa: PLR2004
Expand Down
3 changes: 3 additions & 0 deletions frinx/common/worker/worker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from __future__ import annotations

import logging
import sys
import time
import traceback
from abc import abstractmethod
from functools import reduce
from json import JSONDecodeError
Expand Down Expand Up @@ -266,6 +268,7 @@ def execute_wrapper(self, task: RawTaskIO) -> Any:
logger.debug('Task result %s:', task_result)
return task_result
except Exception as error:
sys.stderr.write(traceback.format_exc())
increment_task_execution_error(metrics, task_type, error)
increment_uncaught_exception(metrics, task_type)
return self.exception_response_handler(
Expand Down
Loading