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

RFC: Lazy check connectivity #5341

Closed
wants to merge 1 commit into from
Closed
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
9 changes: 8 additions & 1 deletion supervisor/jobs/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,14 @@ async def check_conditions(
)

if JobCondition.INTERNET_SYSTEM in used_conditions:
await coresys.sys_supervisor.check_connectivity()
# Connectivity check may take up to 10s (timeout) to complete, and
# hence slow down all exection. If we know connectivity is bad,
# schedule another connectivity check but fail immeaditly.
if coresys.sys_supervisor.connectivity:
await coresys.sys_supervisor.check_connectivity()
else:
coresys.sys_create_task(coresys.sys_supervisor.check_connectivity())

if not coresys.sys_supervisor.connectivity:
raise JobConditionException(
f"'{method_name}' blocked from execution, no supervisor internet connection"
Expand Down
Loading