Skip to content

Commit cbcf036

Browse files
committed
Timeout on status traces that never finish
Give better error messages for status traces that never finish in the `status --watch` command instead instead on erroring out because the access token expired.
1 parent 1680497 commit cbcf036

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* New option `--verbose` for the `datasets ls` command which lists every
1111
relevant metadata field for the listed datasets.
1212
* New output format option for printing CSV: `--format=csv`.
13+
* Better error messages for status traces that never finish in `status --watch`.
1314

1415
## 4.4.0 - 2025-05-14
1516

okdata/cli/commands/status.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,23 @@ def wait_until_done(self, trace_id):
101101
if trace_status != "FINISHED":
102102
print("Waiting for processing to finish", end="", flush=True)
103103

104-
while trace_status != "FINISHED":
104+
attempts = 0
105+
max_attempts = 100
106+
while trace_status != "FINISHED" and attempts < max_attempts:
105107
print(".", end="", flush=True)
106108
sleep(2)
109+
attempts += 1
107110
trace_events = self.get_trace_events(trace_id)
108111
trace_status = StatusCommand.find_latest_event(trace_events)["trace_status"]
109112
print()
110113

114+
if attempts == max_attempts:
115+
print(
116+
"\nWe've waited for a good while now, and processing hasn't "
117+
"yet finished.\nSomething else is most likely wrong, maybe a "
118+
"pipeline hasn't been configured for the dataset?\n"
119+
)
120+
111121
return trace_events
112122

113123
def status_for_id(self, trace_id):

0 commit comments

Comments
 (0)