You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2014/09/27 19:35:57 UTC

git commit: more logging, max time to wait on error

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o 38eb9e4b8 -> 86edd6434


more logging, max time to wait on error


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/86edd643
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/86edd643
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/86edd643

Branch: refs/heads/two-dot-o
Commit: 86edd64342b4049825fa8f8597887a45d24ceb8b
Parents: 38eb9e4
Author: Shawn Feldman <sf...@apache.org>
Authored: Sat Sep 27 11:35:42 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Sat Sep 27 11:35:42 2014 -0600

----------------------------------------------------------------------
 .../usergrid/services/notifications/ApplicationQueueManager.java | 2 +-
 .../apache/usergrid/services/notifications/QueueListener.java    | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/86edd643/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java
index dac3b6a..0f76dc1 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java
@@ -180,7 +180,7 @@ public class ApplicationQueueManager implements QueueManager {
                             }
                             now = System.currentTimeMillis();
                             qm.postToQueue(queueName, message);
-                            LOG.info("ApplicationQueueMessage: notification {} post-queue to device {} duration " + (System.currentTimeMillis() - now) + " ms", notification.getUuid(), deviceRef.getUuid());
+                            LOG.info("ApplicationQueueMessage: notification {} post-queue to device {} duration " + (System.currentTimeMillis() - now) + " ms "+queueName+" queue", notification.getUuid(), deviceRef.getUuid());
                             deviceCount.incrementAndGet();
                             queueMeter.mark();
                         }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/86edd643/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
index 6281ef9..056c3ca 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/QueueListener.java
@@ -193,7 +193,9 @@ public class QueueListener  {
             }catch (Exception ex){
                 LOG.error("failed to dequeue",ex);
                 try {
-                    long sleeptime = sleepWhenNoneFound*(consecutiveExceptions.incrementAndGet());
+                    long sleeptime = sleepWhenNoneFound*consecutiveExceptions.incrementAndGet();
+                    long maxSleep = 15000;
+                    sleeptime = sleeptime > maxSleep ? maxSleep : sleeptime ;
                     LOG.info("sleeping due to failures {} ms", sleeptime);
                     Thread.sleep(sleeptime);
                 }catch (InterruptedException ie){