-
Notifications
You must be signed in to change notification settings - Fork 798
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
introduce db timeout #1222
introduce db timeout #1222
Conversation
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Introduce database statement timeout configuration in `config.py` and apply it in `client.py` for database connections. > > - **Configuration**: > - Add `DATABASE_STATEMENT_TIMEOUT_MS` in `config.py` with default 60000 ms. > - **Database Client**: > - Update `DB_CONNECT_ARGS` in `client.py` to include `statement_timeout` using `DATABASE_STATEMENT_TIMEOUT_MS`. > - Modify `create_async_engine` in `AgentDB` to use `DB_CONNECT_ARGS`. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral)<sup> for 0c2fddc79961a2f547c354c978f30f7882ff9641. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
There was a problem hiding this 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 942020f in 20 seconds
More details
- Looked at
41
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. skyvern/forge/sdk/db/client.py:81
- Draft comment:
Consider adding anelse
clause to handle cases where the database string does not containpostgresql+asyncpg
orpostgresql+psycopg
. This will ensure thatDB_CONNECT_ARGS
is always defined appropriately. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The current implementation sets 'DB_CONNECT_ARGS' with a default value and overrides it if 'postgresql+asyncpg' is in the database string. The comment suggests that there might be other cases that need specific handling, but without evidence of such cases, the default setting seems sufficient. The comment is speculative without strong evidence of an issue.
I might be overlooking specific database configurations that require different 'DB_CONNECT_ARGS'. However, without evidence of such cases, the default setting appears to be a reasonable fallback.
The default setting for 'DB_CONNECT_ARGS' should cover most cases unless there is specific evidence of other configurations needing different settings.
The comment is speculative and lacks strong evidence of an issue. The default setting for 'DB_CONNECT_ARGS' should suffice unless specific cases are identified.
Workflow ID: wflow_av1ras7Rpf6wdanP
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
There was a problem hiding this 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 942020f in 23 seconds
More details
- Looked at
41
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_qJwLPaIApJ0j48UQ
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.
"options": f"-c statement_timeout={settings.DATABASE_STATEMENT_TIMEOUT_MS}", | ||
} | ||
if "postgresql+asyncpg" in settings.DATABASE_STRING: | ||
DB_CONNECT_ARGS = {"server_settings": {"statement_timeout": str(settings.DATABASE_STATEMENT_TIMEOUT_MS)}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using DB_CONNECT_ARGS.update(...)
instead of overwriting the dictionary to ensure other connection arguments are preserved.
DB_CONNECT_ARGS = {"server_settings": {"statement_timeout": str(settings.DATABASE_STATEMENT_TIMEOUT_MS)}} | |
DB_CONNECT_ARGS.update({"server_settings": {"statement_timeout": str(settings.DATABASE_STATEMENT_TIMEOUT_MS)}}) |
There was a problem hiding this 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 542d30e in 11 seconds
More details
- Looked at
20
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. skyvern/forge/sdk/db/client.py:82
- Draft comment:
Thestatement_timeout
value is already a string insettings.DATABASE_STATEMENT_TIMEOUT_MS
, so there's no need to convert it to a string again. Consider removing thestr()
conversion. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces a database statement timeout configuration. The implementation inclient.py
correctly updates theDB_CONNECT_ARGS
based on the database string. However, thestatement_timeout
value forasyncpg
is converted to a string, which is unnecessary since it is already a string in the settings.
Workflow ID: wflow_oC3h2mqOlUMqwngM
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Important
Introduce database statement timeout configuration in
config.py
and apply it inclient.py
for database connections.DATABASE_STATEMENT_TIMEOUT_MS
inconfig.py
with default 60000 ms.DB_CONNECT_ARGS
inclient.py
to includestatement_timeout
usingDATABASE_STATEMENT_TIMEOUT_MS
.create_async_engine
inAgentDB
to useDB_CONNECT_ARGS
.This description was created by for 542d30e. It will automatically update as commits are pushed.