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

Feature: Docker Host Retry #19127

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: host_port_type and host_port_str use in runner.py and retry_with…
…_docker_host decorator
  • Loading branch information
keshavmohta09 committed Dec 18, 2024
commit f999d3c10a03fcfa3e66e88321211179440dfc54
4 changes: 2 additions & 2 deletions ingestion/src/metadata/automations/runner.py
Original file line number Diff line number Diff line change
@@ -83,11 +83,11 @@ def _(
metadata, connection, request.connection.config, automation_workflow
)
except Exception as error:
host_port_str = str(request.connection.config.hostPort or "")
host_port_type = type(request.connection.config.hostPort)
host_port_str = str(getattr(request.connection.config, "hostPort", None) or "")
if "localhost" not in host_port_str:
raise error

host_port_type = type(request.connection.config.hostPort)
docker_host_port_str = host_port_str.replace(
"localhost", "host.docker.internal"
)
11 changes: 6 additions & 5 deletions ingestion/src/metadata/utils/helpers.py
Original file line number Diff line number Diff line change
@@ -502,18 +502,19 @@ def wrapper(*args, **kwargs):
else:
raise error

host_value = (
host_port_str = str(
getattr(config.serviceConnection.root.config, "hostPort", None)
or ""
)
if "localhost" not in host_value:
if "localhost" not in host_port_str:
raise error

docker_host_value = host_value.replace(
host_port_type = type(config.serviceConnection.root.config.hostPort)
docker_host_port_str = host_port_str.replace(
"localhost", "host.docker.internal"
)
setattr(
config.serviceConnection.root.config, "hostPort", docker_host_value
config.serviceConnection.root.config.hostPort = host_port_type(
docker_host_port_str
)
func(*args, **kwargs)