[jira] [Commented] (SLING-4761) Latest view seems to get marked as not current

2015-09-16 Thread Stefan Egli (JIRA)

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

Stefan Egli commented on SLING-4761:


I think this could go into the argument whether 
# 
[{{isCurrent()}}|https://github.com/apache/sling/blob/trunk/bundles/extensions/discovery/api/src/main/java/org/apache/sling/discovery/TopologyView.java#L41]
 should return true even if the properties are not current. I was under the 
assumption that if *anything* changes in the view - ie if a new TopologyView 
object must be created as a result - then (all) the previous one(s) would be 
marked as not current.
# the counter-view could be that {{isCurrent}} only is about the 
instance/cluster part and not the properties ..

I'd vote to stick to 1 as is currently the case .. wdyt?

> Latest view seems to get marked as not current
> --
>
> Key: SLING-4761
> URL: https://issues.apache.org/jira/browse/SLING-4761
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Affects Versions: Discovery Impl 1.1.0, Discovery Impl 1.1.2
>Reporter: Carsten Ziegeler
>Assignee: Carsten Ziegeler
>




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


[jira] [Commented] (SLING-4761) Latest view seems to get marked as not current

2015-09-16 Thread Stefan Egli (JIRA)

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

Stefan Egli commented on SLING-4761:


[~cziegeler], assuming the above assumptions hold, then this would not be an 
issue. Hence removed fix-version for now and assigned to you for a review, thx!

> Latest view seems to get marked as not current
> --
>
> Key: SLING-4761
> URL: https://issues.apache.org/jira/browse/SLING-4761
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Affects Versions: Discovery Impl 1.1.0, Discovery Impl 1.1.2
>Reporter: Carsten Ziegeler
>Assignee: Carsten Ziegeler
>




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


[jira] [Commented] (SLING-4761) Latest view seems to get marked as not current

2015-09-16 Thread Stefan Egli (JIRA)

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

Stefan Egli commented on SLING-4761:


[~cziegeler], good news is I was able to reproduce. Bad news is I don't know 
why the direct 'current'-check makes tests fail..

Here's more details as to what seems happening:
* during startup discovery.impl typically sends out multiple 
{{PROPERTIES_CHANGED}}, this is 'legal'
* in {{JobManagerConfiguration.handleTopologyEvent}} there is a mechanism which 
[ignores the event if only properties have changed but no job-relevant 
ones|https://github.com/apache/sling/blob/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java#L548]
* so if the capabilities-properties do change - even though the view is 
otherwise the same - then this will result in a sequence of 
{{stopProcessing}}/{{startProcessing}}
* in {{startProcessing}} there is a mechanism to [trigger an async job after 
10sec|https://github.com/apache/sling/blob/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java#L527]
 (I guess to avoid blocking the handleTopologyEvent)
* so, what can happen is that such a delay-job is started, then a 
PROPERTIES_CHANGED comes in, that one will have correctly marked the (previous) 
view of the delay-job as not-current
* thus once that delay-job wakes up it *can* see that the view is not current, 
so that is legal

What very likely adds to the confusion of the output you noticed, is the fact 
that +{{TopologyViewImpl}} overwrites hashCode()+ for internal and testing 
purpose (to have topologyViews comparable/'equalable'). So just from the fact 
that you output the hashCode above and given they are equal as a just received 
PROPERTIES_CHANGED event, doesn't make it the *same* view object. In fact, 
adding more logging output showed that they were indeed different views - and 
thus in this case it was valid/correct that the view is not current (the event 
for that change was received 10sec earlier, which is before the last received 
event in your log).

So to reply to the initial reported issues:
bq. It seems that the last view you get via a topology listener might get mark 
as old (not current)
that would then not be true - this view here was marked !current 10 sec before:
{code} 28.05.2015 19:59:06.995 active check, hash code 2037323133, current : 
false{code}
bq. The interesting thing is that the properties changed event is received 
twice, with the same new view object, ten seconds later the view is not current 
anymore but no topology event / change has been received by the listener.
Same here - given the hashCode is the way it is, these assumptions do not hold 
- the views were likely different

Which brings me to the actual issue: I don't know why enabling that direct 
'current' check on makes tests fail. But I suspect the problem is not the 
'current' itself..

> Latest view seems to get marked as not current
> --
>
> Key: SLING-4761
> URL: https://issues.apache.org/jira/browse/SLING-4761
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Affects Versions: Discovery Impl 1.1.0, Discovery Impl 1.1.2
>Reporter: Carsten Ziegeler
>Assignee: Stefan Egli
> Fix For: Discovery Impl 1.1.8
>
>




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


[jira] [Commented] (SLING-4761) Latest view seems to get marked as not current

2015-09-16 Thread Carsten Ziegeler (JIRA)

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

Carsten Ziegeler commented on SLING-4761:
-

[~egli] If I understand this correctly, this means:
a) the view changes if just properties change
b) as the job handling only acts on change on some properties, it does not 
handle all view changes
c) due to a) and b) the issue needs to be solved in the jobs handling
Is this correct?

> Latest view seems to get marked as not current
> --
>
> Key: SLING-4761
> URL: https://issues.apache.org/jira/browse/SLING-4761
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Affects Versions: Discovery Impl 1.1.0, Discovery Impl 1.1.2
>Reporter: Carsten Ziegeler
>Assignee: Carsten Ziegeler
>




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


[jira] [Commented] (SLING-4761) Latest view seems to get marked as not current

2015-09-16 Thread Stefan Egli (JIRA)

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

Stefan Egli commented on SLING-4761:


bq.  a) the view changes if just properties change
yes, the view 'object' changes - but not the content of the view, ie the list 
of instances is the same
bq.  b) as the job handling only acts on change on some properties, it does not 
handle all view changes
hm, as I read the 
[code|https://github.com/apache/sling/blob/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java#L567]
 it should already also handle the TOPOLOGY_CHANGED case - so I'm assuming it 
already handles view changes. so I dont quite see a bug yet in that 
handleTopologyEvent.. perhaps a subtle one: when only irrelevant properties 
change, then it doesn't stop/start - which will maybe leave the job handler to 
eventually stop as it's swallowing the latest (and thus current) event.
bq.  c) due to a) and b) the issue needs to be solved in the jobs handling
yes. probably the safest is to [not swallow the 
event|https://github.com/apache/sling/blob/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java#L551]
 for irrelevant property changes

> Latest view seems to get marked as not current
> --
>
> Key: SLING-4761
> URL: https://issues.apache.org/jira/browse/SLING-4761
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Affects Versions: Discovery Impl 1.1.0, Discovery Impl 1.1.2
>Reporter: Carsten Ziegeler
>Assignee: Carsten Ziegeler
>




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


[jira] [Commented] (SLING-4761) Latest view seems to get marked as not current

2015-09-16 Thread Carsten Ziegeler (JIRA)

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

Carsten Ziegeler commented on SLING-4761:
-

[~egli] My impression was more towards 2 but thinkint about it, 1 is the better 
option

> Latest view seems to get marked as not current
> --
>
> Key: SLING-4761
> URL: https://issues.apache.org/jira/browse/SLING-4761
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Affects Versions: Discovery Impl 1.1.0, Discovery Impl 1.1.2
>Reporter: Carsten Ziegeler
>Assignee: Carsten Ziegeler
>




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


[jira] [Commented] (SLING-4761) Latest view seems to get marked as not current

2015-05-28 Thread Carsten Ziegeler (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14563386#comment-14563386
 ] 

Carsten Ziegeler commented on SLING-4761:
-

It seems that the last view you get via a topology listener might get mark as 
old (not current), this is the events I see:

28.05.2015 19:58:57.015 Received topology event PROPERTIES_CHANGED, hash code 
2037323133, current : true
28.05.2015 19:58:57.022 Received topology event PROPERTIES_CHANGED, hash code 
2037323133, current  : true
28.05.2015 19:59:06.995 active check, hash code 2037323133, current : false

The interesting thing is that the properties changed event is received twice, 
with the same new view object, ten seconds later the view is not current 
anymore but no topology event / change has been received by the listener.

I experienced this with 1.1.0 and can reproduce this. Trying 1.1.2 now


 Latest view seems to get marked as not current
 --

 Key: SLING-4761
 URL: https://issues.apache.org/jira/browse/SLING-4761
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Discovery Impl 1.1.0
Reporter: Carsten Ziegeler
 Fix For: Discovery Impl 1.1.4






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


[jira] [Commented] (SLING-4761) Latest view seems to get marked as not current

2015-05-28 Thread Carsten Ziegeler (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14563416#comment-14563416
 ] 

Carsten Ziegeler commented on SLING-4761:
-

[~egli] WDYT? It still happens to me with 1.1.2

 Latest view seems to get marked as not current
 --

 Key: SLING-4761
 URL: https://issues.apache.org/jira/browse/SLING-4761
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Discovery Impl 1.1.0, Discovery Impl 1.1.2
Reporter: Carsten Ziegeler
 Fix For: Discovery Impl 1.1.4






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


[jira] [Commented] (SLING-4761) Latest view seems to get marked as not current

2015-05-28 Thread Carsten Ziegeler (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14563449#comment-14563449
 ] 

Carsten Ziegeler commented on SLING-4761:
-

Forgot one detail: Although this is random (sometimes it seems to work), it's 
often reproducible

 Latest view seems to get marked as not current
 --

 Key: SLING-4761
 URL: https://issues.apache.org/jira/browse/SLING-4761
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Discovery Impl 1.1.0, Discovery Impl 1.1.2
Reporter: Carsten Ziegeler
 Fix For: Discovery Impl 1.1.4






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