[
https://issues.apache.org/jira/browse/ATLAS-5413?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sheetal Shah updated ATLAS-5413:
--------------------------------
Issue Type: Bug (was: Improvement)
> Null PatchContext when applying typedef JSON patches at startup
> ---------------------------------------------------------------
>
> Key: ATLAS-5413
> URL: https://issues.apache.org/jira/browse/ATLAS-5413
> Project: Atlas
> Issue Type: Bug
> Components: atlas-core
> Reporter: Sheetal Shah
> Assignee: Sheetal Shah
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> When Atlas becomes the active server, it runs components in a fixed order:
> {{AtlasTypeDefStoreInitializer}} *(order 2)* runs before
> {{AtlasPatchService}} *(order 3)*.
> *Problem*
> JSON typedef patches with {{ADD_SUPER_TYPES}} or {{ADD_MANDATORY_ATTRIBUTE}}
> update the type, then register Java follow-up patches via
> {{{}AtlasPatchManager.getContext(){}}}. {{PatchContext}} is created only when
> order 3 runs {{applyAll()}}, so order 2 can see a null context → NPE → patch
> file logged as failed/ignored.
> *Sample log*
>
> {code:java}
> NullPointerException: Cannot invoke "PatchContext.getPatchRegistry()"
> because "context" is null Failed to apply patches in file
> .../patches/*.json. Ignored {code}
> *When it appears*
> First time a patch id is applicable and not yet in the patch registry (common
> after new patch files ship in a release). Later restarts often skip the same
> JSON patch; the Java entity update may still never run if the first attempt
> failed partway.
> *Impact*
> Type definition may update; bulk entity migration may not. Atlas may still
> start.
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)