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: Retry worker on runtime errors #512

Merged
merged 3 commits into from
Sep 20, 2024
Merged

fix: Retry worker on runtime errors #512

merged 3 commits into from
Sep 20, 2024

Conversation

whiterabbit1983
Copy link
Contributor

@whiterabbit1983 whiterabbit1983 commented Sep 20, 2024

Important

Adds retry mechanism and logging to main() in __main__.py for handling RuntimeError exceptions.

  • Adds retry mechanism to main() in __main__.py using tenacity for RuntimeError exceptions.
  • Retries every 20 seconds to ensure worker initialization robustness.
  • Configures logging to capture retry attempts at DEBUG level.

This description was created by Ellipsis for 791ad2b. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 7aedee0 in 13 seconds

More details
  • Looked at 18 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_gUn82EjsSlpmjdsw


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

from ..clients import temporal
from .worker import create_worker


@retry(wait=wait_fixed(20), retry=retry_if_exception_type(RuntimeError))
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding a stop condition to the retry decorator to prevent infinite retries. For example, you can use stop=stop_after_attempt(n) to limit the number of retries.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 791ad2b in 13 seconds

More details
  • Looked at 33 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. agents-api/agents_api/worker/__main__.py:16
  • Draft comment:
    Consider refactoring the logging setup into a separate function or module if used in multiple places.
  • Reason this comment was not posted:
    Confidence changes required: 33%
    The logging setup is repeated and could be refactored for reusability.

Workflow ID: wflow_QreCCRIFLe621Jr7


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@whiterabbit1983 whiterabbit1983 changed the title fix: Retry worker on runtine errors fix: Retry worker on runtime errors Sep 20, 2024
@creatorrr creatorrr merged commit abb3c9d into dev Sep 20, 2024
2 of 6 checks passed
@creatorrr creatorrr deleted the f/vertexai-client branch September 20, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants