Skip to content

Commit

Permalink
fix for dbt hanging while running
Browse files Browse the repository at this point in the history
  • Loading branch information
rajvarkala committed Jun 17, 2023
1 parent ae2c6ad commit 7bebb95
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ def execute_dbt(self, logger: AirbyteLogger):
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
)

logs = []
for line in iter(proc.stdout.readline, b''):
logs.append(line)
proc.stdout.close()

while True:
try:
Expand All @@ -226,7 +231,6 @@ def execute_dbt(self, logger: AirbyteLogger):
continue
break

logs = proc.stdout.readlines()
lastError = None
for log in logs:
j = json.loads(log.decode())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ def execute_dbt(self, logger: AirbyteLogger):
stdout=subprocess.PIPE,
)

logs = []
for line in iter(proc.stdout.readline, b''):
logs.append(line)
proc.stdout.close()

while True:
try:
proc.wait(timeout=2)
Expand All @@ -225,7 +230,6 @@ def execute_dbt(self, logger: AirbyteLogger):
continue
break

logs = proc.stdout.readlines()
lastError = None
for log in logs:
j = json.loads(log.decode())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ def execute_dbt(self, logger: AirbyteLogger):
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
)

logs = []
for line in iter(proc.stdout.readline, b''):
logs.append(line)
proc.stdout.close()

while True:
try:
Expand All @@ -251,7 +256,6 @@ def execute_dbt(self, logger: AirbyteLogger):
continue
break

logs = proc.stdout.readlines()
lastError = None
for log in logs:
j = json.loads(log.decode())
Expand Down

0 comments on commit 7bebb95

Please sign in to comment.