Skip to content

python: surface commit/ingest progress in wait loop warnings - #6780

Merged
blp merged 2 commits into
mainfrom
sdk-wait-progress-logging
Jul 31, 2026
Merged

python: surface commit/ingest progress in wait loop warnings#6780
blp merged 2 commits into
mainfrom
sdk-wait-progress-logging

Conversation

@blp

@blp blp commented Jul 31, 2026

Copy link
Copy Markdown
Member

wait_for_completion and wait_end_of_input logged only elapsed time while blocked, giving no way to tell a slow pipeline from a stalled one (e.g. the adaptive-join balancer barrier) without pulling server-side stats separately. Both now reuse the stats already fetched each poll to report commit progress or processed/input record counts, and reuse LongOperationWarning for wait_end_of_input instead of logging nothing.

Also fixes GlobalPipelineMetrics.from_dict, which never converted the server's commit_progress payload into a CommitProgressSummary -- it stayed a raw dict via the blind dict.update(d), so the class existed but nothing could actually use it.

The immediate reason for this is the CI failure in #6709. It's unclear whether it's hanging or just slow. This should help.

wait_for_completion and wait_end_of_input logged only elapsed time while
blocked, giving no way to tell a slow pipeline from a stalled one (e.g. the
adaptive-join balancer barrier) without pulling server-side stats separately.
Both now reuse the stats already fetched each poll to report commit progress
or processed/input record counts, and reuse LongOperationWarning for
wait_end_of_input instead of logging nothing.

Also fixes GlobalPipelineMetrics.from_dict, which never converted the
server's commit_progress payload into a CommitProgressSummary -- it stayed a
raw dict via the blind __dict__.update(d), so the class existed but nothing
could actually use it.

The immediate reason for this is the CI failure in
#6709.  It's unclear whether
it's hanging or just slow.  This should help.

Signed-off-by: Ben Pfaff <blp@feldera.com>
@blp
blp requested a review from gz July 31, 2026 14:41
@blp blp self-assigned this Jul 31, 2026
@blp blp added CI/CD python Pull requests that update python code labels Jul 31, 2026

@mythical-fred mythical-fred left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait loops now say what they're actually waiting on — commit_progress while a transaction is committing, processed/input records otherwise — instead of just elapsed seconds. That is the difference between "slow" and "stalled" in a CI hang, so this is the right shape of fix for the underlying #6709 symptom.

Also finishes plumbing CommitProgressSummary into GlobalPipelineMetrics.from_dict__dict__.update(d) had left it as a raw dict, so callers of .commit_progress were seeing an untyped payload rather than the class. Straightforward correctness fix.

wait_end_of_input now uses LongOperationWarning too, matching wait_for_completion in both semantics and cadence. Good consolidation.

Minor mechanical notes, non-blocking:

  • The latest_stats.global_metrics.progress_summary() lambdas rely on latest_stats being assigned before any long_op.check(). Both call sites are structured so .stats() runs first inside the loop before .check(), so this is safe as written — worth a one-line comment if anyone ever moves the ordering.
  • CommitProgressSummary.__str__ mirrors the Rust Display impl, including the "1 operators" pluralization quirk. Fine to keep for symmetry, but flagging so nobody "fixes" it in isolation later.
  • CommitProgressSummary.from_dict still uses __dict__.update(d) — same blind-update pattern that produced the bug being fixed here for GlobalPipelineMetrics. Not this PR's job to convert them all, but worth an issue to enumerate the remaining blind-update sites in stats.py.

Signed-off, no AI trailers, unit test coverage for both parsing paths and both progress-summary branches.

APPROVE.

Comment thread python/feldera/stats.py
return status

def __str__(self) -> str:
# Mirrors CommitProgressSummary's Display impl in

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this important?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's just informative.

Comment thread python/feldera/testutils.py Outdated
# Reused by the warning message below so a stalled ingest can be told
# apart from a slow one; check_end_of_input() would fetch and discard it.
latest_stats = None
long_op = LongOperationWarning(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would perhaps name these based on what they are waiting for rather than the class. wait_for_input_end.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's reasonable. I added a commit that renames all of these variables.

This is a little clearer.  Suggested by Mihai.

Signed-off-by: Ben Pfaff <blp@feldera.com>
@blp
blp enabled auto-merge July 31, 2026 16:21
@blp
blp added this pull request to the merge queue Jul 31, 2026
Merged via the queue into main with commit 1896b58 Jul 31, 2026
1 check passed
@blp
blp deleted the sdk-wait-progress-logging branch July 31, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants