Skip to content

Conversation

@XN137
Copy link
Contributor

@XN137 XN137 commented Jul 24, 2025

handling of JsonProcessingException is quite inconsistent across the code base.
many places report the exceptions to PolarisDiagnostics but a lot of counter-examples exist as well.

if we remove the dependency on PolarisDiagnostics this enables a lot of transitive cleanups. most prominently TaskEntity no longer needs to call CallContext.getCurrentContext and thus we can avoid using CallContext.setCurrentContext in many outside callers.

overall this works towards the removal of the ThreadLocal<CallContext> CURRENT_CONTEXT and towards proper CDI.

@github-project-automation github-project-automation bot moved this to PRs In Progress in Basic Kanban Board Jul 24, 2025
@XN137 XN137 force-pushed the remove-PolarisDiagnostics-from-json-utils branch from 1627105 to 8b6547e Compare July 24, 2025 10:17
@XN137
Copy link
Contributor Author

XN137 commented Jul 24, 2025

list of some examples where JSON error handling is inconsistent / not using PolarisDiagnostics:

@XN137 XN137 marked this pull request as ready for review July 24, 2025 10:51
snazy
snazy previously approved these changes Jul 24, 2025
@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Jul 24, 2025
@XN137 XN137 force-pushed the remove-PolarisDiagnostics-from-json-utils branch from 8b6547e to fb9734e Compare July 24, 2025 14:05
@XN137
Copy link
Contributor Author

XN137 commented Jul 24, 2025

rebased after ca85339 due to tiny conflict in ManagementServiceTest.java

snazy
snazy previously approved these changes Jul 24, 2025
dimas-b
dimas-b previously approved these changes Jul 24, 2025
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.

LGTM 👍 Nice refactoring to reduce reliance on thread locals! Thanks, @XN137 !

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Add ex's message to the re-thrown exception message for each of trouble-shooting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i've added the message as you suggested.

iirc some lint tools flag this as a problem, as you are simply repeating the same information.
also from my experience the jackson exceptions are often not very helpful if you dont also have the exact JSON input to compare to (which i did not include because i think properties could contain credentials etc.).

Copy link
Contributor

Choose a reason for hiding this comment

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

not "simply" repeating :) In some cases only the exception message is available for debugging, while the full stack trace takes extra efforts to obtain.

I'm fine either way, but thanks for addressing my nitpick :)

@XN137 XN137 dismissed stale reviews from dimas-b and snazy via 9134cd4 July 25, 2025 05:56
@XN137 XN137 force-pushed the remove-PolarisDiagnostics-from-json-utils branch from fb9734e to 9134cd4 Compare July 25, 2025 05:56
@XN137
Copy link
Contributor Author

XN137 commented Jul 25, 2025

rebased after trivial merge conflicts in:

persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java
polaris-core/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java

dimas-b
dimas-b previously approved these changes Jul 25, 2025
snazy
snazy previously approved these changes Jul 25, 2025
@snazy
Copy link
Member

snazy commented Jul 28, 2025

@XN137 can you fix the conflicts?

@XN137 XN137 dismissed stale reviews from snazy and dimas-b via dbf9556 July 28, 2025 07:38
@XN137 XN137 force-pushed the remove-PolarisDiagnostics-from-json-utils branch from 9134cd4 to dbf9556 Compare July 28, 2025 07:38
@XN137
Copy link
Contributor Author

XN137 commented Jul 28, 2025

rebased after trivial merge conflict:

runtime/service/src/test/java/org/apache/polaris/service/quarkus/catalog/AbstractIcebergCatalogTest.java

@snazy snazy merged commit 756e535 into apache:main Jul 28, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Jul 28, 2025
@XN137 XN137 deleted the remove-PolarisDiagnostics-from-json-utils branch July 28, 2025 08:36
snazy added a commit to snazy/polaris that referenced this pull request Nov 20, 2025
* fix(deps): update dependency com.google.errorprone:error_prone_core to v2.41.0 (apache#2181)

* Simplify bootstrapServiceAndCreatePolarisPrincipalForRealm (apache#2172)

this is a small follow-up to 5faa371
because the same pattern existed for this method.

note that we do some minor additional "formatting" changes to minimize
the diff between the two files (as they were originally copy pasted).
this could lead to having a common base class in the future.

* fix(deps): update dependency boto3 to v1.39.13 (apache#2182)

* Add podman support (apache#2143)

* Add Polaris Community Meeting 2025-07-24 (apache#2184)

* fix(deps): update dependency com.adobe.testing:s3mock-testcontainers to v4.7.0 (apache#2185)

* Push AccessConfig creation to PolarisStorageIntegration (apache#2171)

This refactoring does not change Polaris behaviour.

* Move storage-specific access properties processing logic from
  core code to storage integration implementations.

* Add `isExpirationTimestamp` flag to `StorageAccessProperty` to
  allow them to be processed uniformly.

* Prepare for supporting access config properties that may have
  different values in Polaris Servers and Clients. This enables
  future enhancements to support different S3 endpoint DNS names
  in servers and clients for apache#1530

* Fix doc to remove privileges may take up to one hour to take effect and add Policy to securable object (apache#2009)

* fix(deps): update dependency boto3 to v1.39.14 (apache#2186)

* chore(deps): update plugin jetbrains-changelog to v2.3.0 (apache#2187)

* fix(deps): update dependency software.amazon.awssdk:bom to v2.32.9 (apache#2191)

* Add Principal lookup helpers to PolarisMetaStoreManager (apache#2174)

`PolarisMetaStoreManager.readEntityByName` is quite a low-level api, so we can simplify a lot of callers with additional helpers:

- add `PolarisMetaStoreManager.findRootPrincipal`
- add `PolarisMetaStoreManager.findPrincipalByName`
- add `PolarisMetaStoreManager.findPrincipalRoleByName`

also we now prefer `PolarisEntityConstants` where applicable

* Remove PolarisDiagnostics from json utils (apache#2176)

With transitive cleanups of, PolarisStorageConfigurationInfo, ConnectionConfigInfoDpo, BaseMetaStoreManager, PolarisObjectMapperUtil, CurrentContext

* Fix Namespace resolution on grant/revoke privilege operations (apache#2170)

* Fix Namespace resolution on grant/revoke privilege operations

* Move isFullyResolvedNamespace to PolarisResolvedPathWrapper

* fix(deps): update dependency boto3 to v1.39.15 (apache#2199)

* fix(deps): update dependency com.google.cloud:google-cloud-storage-bom to v2.54.0 (apache#2200)

* fix(deps): update dependency boto3 to v1.39.16 (apache#2209)

* chore(deps): update actions/stale digest to a92fd57 (apache#2208)

* fix(deps): update quarkus platform and group to v3.25.0 (apache#2167)

* NoSQL updates

* Last merged commit 914be46

---------

Co-authored-by: Mend Renovate <[email protected]>
Co-authored-by: Christopher Lambert <[email protected]>
Co-authored-by: Yong Zheng <[email protected]>
Co-authored-by: JB Onofré <[email protected]>
Co-authored-by: Dmitri Bourlatchkov <[email protected]>
Co-authored-by: CG <[email protected]>
Co-authored-by: Pooja Nilangekar <[email protected]>
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