Skip to content

Core: resolveAll() must be called before reading resolution results#3064

Merged
flyrain merged 3 commits intoapache:mainfrom
flyrain:resolve_call
Nov 20, 2025
Merged

Core: resolveAll() must be called before reading resolution results#3064
flyrain merged 3 commits intoapache:mainfrom
flyrain:resolve_call

Conversation

@flyrain
Copy link
Contributor

@flyrain flyrain commented Nov 17, 2025

To fail fast and explicitly when resolveAll() isn't called before reading the results

Checklist

  • 🛡️ Don't disclose security issues! (contact security@apache.org)
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

Copy link
Contributor

@singhpk234 singhpk234 left a comment

Choose a reason for hiding this comment

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

Thanks for fix @flyrain !

// Set when resolveAll is called
private ResolverStatus primaryResolverStatus = null;

private ResolverStatus requirePrimaryResolverStatus() {
Copy link
Contributor

Choose a reason for hiding this comment

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

minor : require gives an impression that its just doing assertion, but its additionally returning status how about this

Suggested change
private ResolverStatus requirePrimaryResolverStatus() {
private ResolverStatus safeGetPrimaryResolverStatus() {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored a bit. Thanks for the suggestion.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thx! The new code is much nicer 🙂


public PolarisResolvedPathWrapper getResolvedReferenceCatalogEntity(
boolean prependRootContainer) {
requirePrimaryResolverStatus();
Copy link
Contributor

Choose a reason for hiding this comment

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

[doubt] is just checking status not null sufficient ? or should we bake the assertion that that status != null and status = SUCCESS ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point. Removed this line to avoid any behavior change.

Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

@flyrain : could you explain why "resolveAll() must be called before reading resolution results"? The PR description provides information about enforcing it, but the rationale for doing that is not very clear... at least to me 😅 Thx!

@flyrain
Copy link
Contributor Author

flyrain commented Nov 17, 2025

@flyrain : could you explain why "resolveAll() must be called before reading resolution results"? The PR description provides information about enforcing it, but the rationale for doing that is not very clear... at least to me 😅 Thx!

The result will be invalid, or null if it's not invoked. The concurrent code actually already enforce that. You can find the following code in each place reading the result, but NPE will be threw in case of resovleAll() not called. This PR is mainly to make it fail explicitly instead of a NPE.

if (primaryResolverStatus.getStatus() != ResolverStatus.StatusEnum.SUCCESS) {
   return null
}

dimas-b
dimas-b previously approved these changes Nov 17, 2025
@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Nov 17, 2025
@dimas-b dimas-b requested a review from dennishuo November 17, 2025 19:37
Copy link
Contributor

@singhpk234 singhpk234 left a comment

Choose a reason for hiding this comment

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

LGTM thanks @flyrain !

@flyrain flyrain merged commit 415c9c0 into apache:main Nov 20, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Nov 20, 2025
snazy added a commit to snazy/polaris that referenced this pull request Feb 11, 2026
* Docs: update Helm Chart page to show usage without cloning Polaris github repo (apache#2939)

* Docs: update Helm Chart page to show usage without cloning Polaris github repo

* Apply suggestions from code review

* Add separate flows in Helm Chart doc for installing released chart and images vs building from source

---------

Co-authored-by: Alexandre Dutra <adutra@apache.org>

* docs: improve getting started and README documentation (apache#2267)

* The outdated config snippets and health-checks are removed from the index

* The binary guide stays focused and concise

* Update changelog with missing 1.3.0 features (apache#3087)

* Update registry.access.redhat.com/ubi9/openjdk-21-runtime Docker tag to v1.23-6.1763034977 (apache#3092)

* Update docker.io/jaegertracing/all-in-one Docker tag to v1.75.0 (apache#3093)

* feat: Make generate_clients.py windows compatible (apache#3084)

* Make generate_clients.py windows compatible

* Updated CHANGELOG.md

* PRs: Remove markdown-links-check from required checks (apache#3102)

The "Check Markdown links" workflow is known to produce false failures, leading to apache#3097.

This change is intended to unblock PRs due to these false failures.

* Update dependency com.diffplug.spotless:spotless-plugin-gradle to v8.1.0 (apache#3083)

* Update dependency com.diffplug.spotless:spotless-plugin-gradle to v8.1.0

* spotlessApply

---------

Co-authored-by: Robert Stupp <snazy@snazy.de>

* chore(deps): update gradle to v9.2.1 (apache#3069)

* chore(deps): update gradle to v9.2.1

* Fix Grale wrapper SHA

---------

Co-authored-by: Robert Stupp <snazy@snazy.de>

* chore(deps): update mongo docker tag to v8.2.2 (apache#3100)

* chore(deps): update docker.io/mongo docker tag to v8.2.2 (apache#3099)

* Source-tarball - eliminate git-gzip risk (apache#3075)

Details in the `git archive` chapter in https://reproducible-builds.org/docs/archives/

* NoSQL: Allow `null` IndexKey (de)serialization (apache#3076)

This change adopts the implementation to the API specification.

* PRs: Re-add markdown-links-check step (apache#3103)

The step was disabled in apache#3102 to pass CI and enable merging.

* NoSQL: Add maintenance implementation (apache#3077)

* Inject DefaultFileIOFactory in tests (apache#3043)

* Inject DefaultFileIOFactory in tests

also simplify `TaskFileIOSupplier` usage in tests, which allows removal
of `TestFileIOFactory`.

* Update Quarkus Platform and Group to v3.29.4 (apache#3094)

* Site: Replace feather logo (apache#3101)

The ASF has a new logo, a leaf. There is sadly no free icon that matches the new logo, so replacing the feather-ASF with "The ASF" in the top-bar navigation.

* Update actions/checkout action to v6 (apache#3106)

* Core: resolveAll() must be called before reading resolution results (apache#3064)

* Site: Added GCS related Bucket Properties for vending credentials. (apache#3066)

* Publish/pom: don't include test-fixtures dependencies as runtime (apache#3085)

The list of dependencies in pom's includes the api/runtime elements of the test-fixtures, which is not what should be published, as it "pulls up" deps like junit, mockito and assertj as Maven runtime scope dependencies.
This change fixes this.

* Increase javadoc visibility in `persistence/nosql/persistence/cdi/weld` (apache#3110)

This is to fix javadoc error: `No public or protected classes found to document`

* Disable cloud storage tests that would use @tempdir (apache#3095)

Disable tests from ViewCatalogTests for cloud storage integration tests
(S3, ADLS, GCS) that would otherwise use @tempdir. Since @tempdir internally
uses Paths.get, it cannot point to cloud storage paths. These tests remain
enabled for file-based integration tests.

* Remove 'beta' label for Generic Table (apache#3096)

* remove beta label

* address comments for change log

---------

Co-authored-by: Pierre Laporte <pierre@pingtimeout.fr>

* Update dependency jupyterlab to v4.5.0 (apache#3074)

* chore: Fix md link check in GH action (apache#3128)

* Fix md link check in GH action

* Fix md link check in GH action

* Update dependency pre-commit to v4.5.0 (apache#3123)

* Update dependency software.amazon.awssdk:bom to v2.39.2 (apache#3127)

* NoSQL: authZ API, SPI, impl and store (apache#3078)

NoSQL base functionality for ACLs

* NoSQL: Quarkus distributed cache invalidation (apache#3105)

Adds support for distributed NoSQL cache invalidation leveraging Quarkus.

* NoSQL: adjustments / merge fixes

* Last merged commit e124348

---------

Co-authored-by: Oleg Soloviov <40199597+olsoloviov@users.noreply.github.com>
Co-authored-by: Alexandre Dutra <adutra@apache.org>
Co-authored-by: Subham <subham.sangwan@adypu.edu.in>
Co-authored-by: Pierre Laporte <pierre@pingtimeout.fr>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Yong Zheng <yongzheng0809@gmail.com>
Co-authored-by: Christopher Lambert <xn137@gmx.de>
Co-authored-by: Yufei Gu <yufei@apache.org>
Co-authored-by: Saksham Ratra <sakshamratra.0106@gmail.com>
Co-authored-by: Dmitri Bourlatchkov <dmitri.bourlatchkov@gmail.com>
Co-authored-by: Tamas Mate <50709850+tmater@users.noreply.github.com>
Co-authored-by: Yun Zou <yunzou.colostate@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants