[ 
https://issues.apache.org/jira/browse/ATLAS-5413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18119180#comment-18119180
 ] 

ASF subversion and git services commented on ATLAS-5413:
--------------------------------------------------------

Commit 11e86ae888c19162e85b9c37b5dcb3a2cbfa8635 in atlas's branch 
refs/heads/master from sheetalshah1007
[ https://gitbox.apache.org/repos/asf?p=atlas.git;h=11e86ae88 ]

ATLAS-5413: Initialize PatchContext before typedef JSON patches register Java 
handlers (#766)

Co-authored-by: Sheetal Shah <[email protected]>

> 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
>            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)

Reply via email to