incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1537937 - /sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/timed/TimedEventSender.java
Date Fri, 01 Nov 2013 13:45:20 GMT
Author: bdelacretaz
Date: Fri Nov  1 13:45:20 2013
New Revision: 1537937

URL: http://svn.apache.org/r1537937
Log:
SLING-3220 - avoid infinite loop in TimedEventSender, patch contributed by Marc Pfaff, thanks!

Modified:
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/timed/TimedEventSender.java

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/timed/TimedEventSender.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/timed/TimedEventSender.java?rev=1537937&r1=1537936&r2=1537937&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/timed/TimedEventSender.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/timed/TimedEventSender.java
Fri Nov  1 13:45:20 2013
@@ -252,6 +252,15 @@ public class TimedEventSender
                     }
 
                     event = null;
+                } else if (Utility.TOPIC_STOPPED.equals(event.getTopic())){
+                    // stopScheduling() puts this event on the queue, but the intention is
unclear to me.
+                    // as the threadStarted flag ensures the background thread is only started
once, we must not stop
+                    // the thread, otherwise its never started again upon topology changes.
+                    event = null;
+                } else {
+                    // to ensure the event is reset to null in any case, in order to take
from the queue again
+                    // and to not fall into an endless busy loop
+                    event = null;
                 }
             }
         }



Mime
View raw message