GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Report single-feature-view spark_application materialization success by adarshsm · Pull Request #6700 · feast-dev/feast

Conversation

@adarshsm

@adarshsm adarshsm commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What this does

Fixes #6673.

Every single-feature-view materialization on the spark_application batch engine is reported as a failure:

Exception: SparkApplication feast-sa-<job-id> not found

even though the Spark driver already materialized the features and updated the registry. Automation calling feast materialize or the feature server's /materialize endpoint sees a failure and may retry work that already succeeded. It is deterministic for exactly one feature view.

Root cause

materialize() deletes the SparkApplication CR in its finally immediately after _build_per_fv_jobs() returns:

try:
    self._wait_for_completion(job)
    return self._build_per_fv_jobs(registry, tasks, job_id, job)
finally:
    self._cleanup(job_id)          # deletes the CR

For a single feature view, _build_per_fv_jobs() short-circuited and returned the live polling job:

if len(tasks) <= 1:
    return [job for _ in tasks]

FeatureStore._submit_and_process_materialization_jobs() then re-checks job.status(). On success the job has no captured error, so status() re-queries the CR that _cleanup() just deleted → 404 → _error set → ERROR raised. (On genuine failure job._error is already set and status() short-circuits, so only the success path 404s.)

Fix

Resolve the per-FV outcome from registry state for every task count — exactly what the multi-FV path already does. The driver pod sets each materialized FV to AVAILABLE_ONLINE, so:

  • materialized FV → CompletedMaterializationJob, which reports SUCCEEDED with no Kubernetes call and is safe after cleanup;
  • unmaterialized FV → ERROR (was not materialized …), consistent with the existing multi-FV behavior; the Spark driver's error detail is already logged by _wait_for_completion.

The now-unused job parameter to _build_per_fv_jobs() is dropped.

Tests

The existing single-task test asserted the buggy behavior (return the live job, skip the registry). Rewrote it to require resolution from registry state with no CR query, and added a single-failed-FV case. All spark_application unit tests pass; the fix is exercised entirely with mocked K8s/registry — no live cluster needed.

Verified the before/after on the real classes: a live job re-checked after CR deletion returns ERROR "… not found" (the reported symptom), while the fixed single-FV path returns SUCCEEDED and makes no get_namespaced_custom_object call.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@adarshsm
adarshsm requested a review from a team as a code owner August 3, 2026 10:10
@codecov-commenter

codecov-commenter commented Aug 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 46.80%. Comparing base (9affee5) to head (abf7dc5).

Files with missing lines Patch % Lines
...infra/compute_engines/spark_application/compute.py 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6700      +/-   ##
==========================================
- Coverage   46.80%   46.80%   -0.01%     
==========================================
  Files         415      415              
  Lines       50397    50395       -2     
  Branches     7215     7214       -1     
==========================================
- Hits        23589    23588       -1     
  Misses      25155    25155              
+ Partials     1653     1652       -1     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 48.13% <0.00%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
...infra/compute_engines/spark_application/compute.py 55.61% <0.00%> (-0.47%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9affee5...abf7dc5. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

franciscojavierarceo
franciscojavierarceo approved these changes Aug 3, 2026
View reviewed changes

@franciscojavierarceo franciscojavierarceo left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The single-task path now resolves the outcome from registry state before the SparkApplication CR is deleted, and the tests cover both successful and failed single-feature-view materializations without a post-cleanup Kubernetes lookup. I found no blocking issue in the remote diff.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@aniketpalu

aniketpalu commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Thanks @adarshsm for raising the fix. Please fix the CI. LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aniketpalu
aniketpalu approved these changes Aug 6, 2026
View reviewed changes
adarshsm @adarshsm
fix: Report single-feature-view spark_application materialization suc…
abf7dc5
…cess

`SparkApplicationComputeEngine.materialize()` deletes the SparkApplication CR
in its `finally` immediately after `_build_per_fv_jobs()` returns. For a single
feature view, `_build_per_fv_jobs()` short-circuited and returned the live
polling job. `FeatureStore._submit_and_process_materialization_jobs()` then
re-checks `job.status()`, which re-queries the just-deleted CR, gets a 404, and
raises `SparkApplication feast-sa-<id> not found` — for a materialization that
actually succeeded and already updated the registry. Automation calling
`feast materialize` or `/materialize` sees a failure and may retry completed
work. The bug is deterministic for exactly one feature view.

Resolve the per-FV outcome from registry state for every task count, exactly as
the multi-FV path already does: a materialized FV (`AVAILABLE_ONLINE`) becomes a
`CompletedMaterializationJob`, which reports SUCCEEDED without any Kubernetes
call and is therefore safe after cleanup. The now-unused `job` parameter is
dropped. Genuine failures still surface as ERROR (the FV is not
`AVAILABLE_ONLINE`), and the Spark driver's error detail is already logged by
`_wait_for_completion`.

Updated the single-task unit test, which previously asserted the buggy
behavior (return the live job, skip the registry), to require resolution from
registry state with no CR query, and added a single-failed-FV case.

Fixes feast-dev#6673

Signed-off-by: adarshsm <[email protected]>
@adarshsm
adarshsm force-pushed the fix/spark-single-fv-materialization-status branch from f65040a to abf7dc5 Compare August 12, 2026 10:26
@adarshsm

adarshsm commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@aniketpalu I rebased onto current master (abf7dc5), but the red check is not coming from this PR — master is red on its own.

The failure is always in sdk/python/tests/unit/test_feature_server.py, and it is the test environment rather than the code:

  • this PR, unit-test-python (3.11): ImportError: cannot import name 'bcat' from 'psutil._common' — a half-installed psutil in the runner venv
  • this PR before the rebase, unit-test-python (3.10): importlib.metadata.PackageNotFoundError: No package metadata was found for protobuf
  • master 9affee5 (run 31501371702), unit-test-python (3.10): importlib_metadata.MetadataNotFound: No package metadata was found — same file, 1 failed / 2529 passed

This PR only touches infra/compute_engines/spark_application/compute.py and its own test, and nothing in it imports the feature server. Every other job is green, including unit-test-python (3.12) on both ubuntu and macOS.

Looks like a flaky dependency resolution in the CI install step rather than anything a PR can fix. Happy to re-run once master is green if you would rather see a clean board first.

aniketpalu reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ntkathole ntkathole added the ok-to-test label Aug 12, 2026
ntkathole
ntkathole approved these changes Aug 12, 2026
View reviewed changes
@ntkathole
ntkathole merged commit a9219d9 into feast-dev:master Aug 13, 2026
37 of 39 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@franciscojavierarceo franciscojavierarceo franciscojavierarceo approved these changes
@ntkathole ntkathole ntkathole approved these changes
+1 more reviewer
@aniketpalu aniketpalu aniketpalu approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

ok-to-test

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

spark_application engine reports successful single-feature-view materializations as failure

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@adarshsm @codecov-commenter @aniketpalu @franciscojavierarceo @ntkathole
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.