vigneshio opened a new pull request, #4811:
URL: https://github.com/apache/polaris/pull/4811
Fix NPE when entity is removed during dropEntity
During dropEntity, after we delete the grants, we do lookup on the other
entities to increase their grant version.
lookupEntities can return null if that entity was already dropped or purged
by some other process at the same time. This is mentioned in the
BasePersistence contract.
We were calling method directly on the entity without checking for null.
This was causing NullPointerException.
Fixed by adding simple null check like this:
if (originalEntity == null) {
continue; // entity was concurrently dropped/purged after grants were
removed
}
Same change done in two files:
- AtomicOperationMetaStoreManager.java
- TransactionalMetaStoreManagerImpl.java
Also added entry in CHANGELOG.md.
## Checklist
- [ ] Don't disclose security issues! (contact [email protected])
- [x] Clearly explained why the changes are needed, or linked related issues
- [ ] 🧪 Added/updated tests with good coverage, or manually tested (and
explained how) - small null guard. Concurrent drop case is difficult to test so
no new test added
- [x] Added comments for complex logic
- [x] 🧾 Updated `CHANGELOG.md` (if needed)
- [ ] Updated documentation in `site/content/in-dev/unreleased` (if needed)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]