codeant-ai-for-open-source[bot] commented on code in PR #42624:
URL: https://github.com/apache/superset/pull/42624#discussion_r3694276608
##########
superset/utils/webdriver.py:
##########
@@ -1051,6 +1452,12 @@ def get_screenshot( # noqa: C901
unexpected_errors,
)
+ if report_execution_context:
+ phase_timeout(
+ "screenshot_capture",
+ None,
+ report_execution_context.post_capture_reserve_seconds,
+ )
img = element.screenshot_as_png
Review Comment:
**Suggestion:** The Selenium capture phase only calls `phase_timeout` to
validate that some budget remains, but does not apply that timeout to
`element.screenshot_as_png`. Selenium's screenshot command has no timeout
inherited from `set_page_load_timeout`, so it can block past the report
deadline and consume the delivery/cleanup reserve. Use a bounded capture
mechanism or enforce the deadline around the screenshot operation. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Selenium-backed reports can exceed their configured execution deadline.
- ⚠️ Blocked capture can consume delivery and cleanup reserves.
- ⚠️ Celery may terminate workers before report failure cleanup completes.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=e78104ba76cf4ad5b365fea76330d987&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=e78104ba76cf4ad5b365fea76330d987&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/utils/webdriver.py
**Line:** 1455:1461
**Comment:**
*Logic Error: The Selenium capture phase only calls `phase_timeout` to
validate that some budget remains, but does not apply that timeout to
`element.screenshot_as_png`. Selenium's screenshot command has no timeout
inherited from `set_page_load_timeout`, so it can block past the report
deadline and consume the delivery/cleanup reserve. Use a bounded capture
mechanism or enforce the deadline around the screenshot operation.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42624&comment_hash=432ace137555663eb4e2db09a5ba210f33fba285a1777d0e550c8f73d674f814&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42624&comment_hash=432ace137555663eb4e2db09a5ba210f33fba285a1777d0e550c8f73d674f814&reaction=dislike'>👎</a>
##########
docs/admin_docs/configuration/alerts-reports.mdx:
##########
@@ -244,6 +244,51 @@ class CeleryConfig:
}
CELERY_CONFIG = CeleryConfig
+# Scheduled reports share one deadline across browser readiness, capture/PDF
+# generation, delivery, and terminal-state persistence. The effective budget
+# for a schedule is min(this value, the schedule's working_timeout), so the
+# per-schedule field keeps its meaning as a user-facing cap. The default (one
+# hour) matches the historical working_timeout default, so upgrading changes
+# no default behavior; lower it to enforce a tighter report SLA.
+ALERT_REPORTS_EXECUTION_BUDGET_SECONDS = 3600
+
+# These reserves are part of (not additions to) the total budget and their sum
+# must be less than it. Readiness polling stops in time to leave capacity for
+# the later phases.
+ALERT_REPORTS_EXECUTION_CAPTURE_RESERVE_SECONDS = 60
+ALERT_REPORTS_EXECUTION_DELIVERY_RESERVE_SECONDS = 120
+ALERT_REPORTS_EXECUTION_CLEANUP_RESERVE_SECONDS = 30
+
+# Celery's hard limit leaves this additional window for terminal cleanup after
+# the 15-minute soft limit. ALERT_REPORTS_WORKING_TIME_OUT_KILL controls these
+# Celery limits; disabling it does not disable the application deadline above.
+ALERT_REPORTS_EXECUTION_HARD_TIMEOUT_GRACE_SECONDS = 30
Review Comment:
**Suggestion:** This comment says the hard-limit grace follows a 15-minute
soft limit, but the documented default execution budget and resulting soft
limit are 3600 seconds (one hour). This gives operators an incorrect timeout
expectation; describe the grace as following the resolved execution budget
instead of naming 15 minutes. [comment mismatch]
<details>
<summary><b>Severity Level:</b> Minor 🧹</summary>
```mdx
- ⚠️ Operators receive incorrect Celery timeout guidance.
- ⚠️ Deployment timeout sizing may use the wrong soft-limit assumption.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=c39003c11a7c43128adaa607fcab4f8f&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=c39003c11a7c43128adaa607fcab4f8f&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** docs/admin_docs/configuration/alerts-reports.mdx
**Line:** 262:265
**Comment:**
*Comment Mismatch: This comment says the hard-limit grace follows a
15-minute soft limit, but the documented default execution budget and resulting
soft limit are 3600 seconds (one hour). This gives operators an incorrect
timeout expectation; describe the grace as following the resolved execution
budget instead of naming 15 minutes.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42624&comment_hash=27bcc379a40ee919b8785305276b2f2b3aa58932b447b09cbbdb70b7ed1a27f2&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42624&comment_hash=27bcc379a40ee919b8785305276b2f2b3aa58932b447b09cbbdb70b7ed1a27f2&reaction=dislike'>👎</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]