Skip to content

Cap suggested sleep time#2402

Open
jmoreira-valory wants to merge 2 commits intomainfrom
jmoreira-valory/predict-691-fix-bug-causing-agent-crash-in-performance-summary
Open

Cap suggested sleep time#2402
jmoreira-valory wants to merge 2 commits intomainfrom
jmoreira-valory/predict-691-fix-bug-causing-agent-crash-in-performance-summary

Conversation

@jmoreira-valory
Copy link
Collaborator

Proposed changes

Suggested sleep time may grow exponentially, causing to pass out-of-bound values to the sleep method down the call stack.

Fixes

Types of changes

What types of changes does your code introduce? (A breaking change is a fix or feature that would cause existing functionality and APIs to not work as expected.)
Put an x in the box that applies

  • Non-breaking fix (non-breaking change which fixes an issue)
  • Breaking fix (breaking change which fixes an issue)
  • Non-breaking feature (non-breaking change which adds functionality)
  • Breaking feature (breaking change which adds functionality)
  • Refactor (non-breaking change which changes implementation)
  • Messy (mixture of the above - requires explanation!)

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I am making a pull request against the main branch (left side). Also you should start your branch off our main.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have locally run AI agents that could be impacted and they do not present failures derived from my changes
  • Public-facing documentation has been updated with the changes affected by this PR. Even if the provided contents are not in their final form, all significant information must be included.
  • Any backwards-incompatible/breaking change has been clearly documented in the upgrading document.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

DEFAULT_BACKOFF_FACTOR: float = 2.0
DEFAULT_TYPE_NAME: str = "str"
DEFAULT_CHAIN = "ethereum"
MAX_SUGGESTED_SLEEP_TIME = 3600
Copy link
Member

Choose a reason for hiding this comment

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

Could make this configurable

Copy link
Collaborator

Choose a reason for hiding this comment

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

Making this configurable would beat the purpose of the check.

Copy link
Collaborator

@Adamantios Adamantios left a comment

Choose a reason for hiding this comment

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

This should be apparent to the dev setting the env vars for the sleep time. Instead, I suggest checking the backoff factor && retries in the model during the params init, warning the user, and failing early.

@jmoreira-valory
Copy link
Collaborator Author

@Adamantios even if doing like that the problem will also happen. How do you suggest to proceed?

@Adamantios
Copy link
Collaborator

@Adamantios even if doing like that the problem will also happen. How do you suggest to proceed?

If we were to go for that solution, this message would let the dev understand that they are using irrational values for the backoff + retries, giving them a chance to revisit and reset them.

Another option would be to go for the solution you already implemented and warn the user, e.g.:

sleep time capped to x sec

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.

3 participants