Sheetal Shah created ATLAS-5413:
-----------------------------------

             Summary: 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: Improvement
          Components:  atlas-core
            Reporter: Sheetal Shah
            Assignee: Sheetal Shah


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)

Reply via email to