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

Tommaso Teofili commented on SLING-4828:
----------------------------------------

bq. Did you experience ResourceHelper.getOrCreateResource returning null? Or is 
it that a property is null? Or Both?

the only fact I experienced is that a job gets not correctly serialized as one 
of the persisted properties (in JCR) happened to be null even if the passed 
property was not null, whether that results in a null Resource (because there's 
an error in writing which doesn't raise an exception) or not I don't know; 
that's why I was thinking to double checking the resource is not null and / or 
checking the persisted properties match the properties passed to the JobManager 
for creating the Job.
The bottom line is that if there's any issue in persisting the Job it should 
fail fast.

> JobManagerImpl job persisting doesn't check the created resource 
> -----------------------------------------------------------------
>
>                 Key: SLING-4828
>                 URL: https://issues.apache.org/jira/browse/SLING-4828
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Event 3.6.0
>            Reporter: Tommaso Teofili
>
> {{JobManagerImpl#addJob}} persists the job to be started in {{writeJob}} 
> however the result of {{ResourceHelper.getOrCreateResource}} is neither 
> checked (!=null) nor used so it can be that the returned {{Resource}} is null 
> or corrupted and therefore the job could not be persisted correctly, see 
> https://github.com/apache/sling/blob/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java#L846.
> E.g. I've experienced some cases where a binary property of a JCR node ends 
> up being null but that is only noticed when the job is executed, not when 
> it's persisted.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to