You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by sj...@apache.org on 2018/03/19 18:07:02 UTC

asterixdb-bad git commit: Add timeout to Broker connection for notifications

Repository: asterixdb-bad
Updated Branches:
  refs/heads/master 185b63d4f -> a7756f103


Add timeout to Broker connection for notifications

Change-Id: Ic2803bdba15e6742a084a84d483996ab7ab45a8e


Project: http://git-wip-us.apache.org/repos/asf/asterixdb-bad/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb-bad/commit/a7756f10
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb-bad/tree/a7756f10
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb-bad/diff/a7756f10

Branch: refs/heads/master
Commit: a7756f1036825653b02c9a9d8ed96758fe24dd34
Parents: 185b63d
Author: Steven Glenn Jacobs <sj...@ucr.edu>
Authored: Fri Mar 16 12:36:49 2018 -0700
Committer: Steven Glenn Jacobs <sj...@ucr.edu>
Committed: Fri Mar 16 12:36:49 2018 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/asterix/bad/ChannelJobService.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/a7756f10/asterix-bad/src/main/java/org/apache/asterix/bad/ChannelJobService.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/ChannelJobService.java b/asterix-bad/src/main/java/org/apache/asterix/bad/ChannelJobService.java
index 1db0669..41853b9 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/ChannelJobService.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/ChannelJobService.java
@@ -106,6 +106,7 @@ public class ChannelJobService {
 
             connection.setUseCaches(false);
             connection.setDoOutput(true);
+            connection.setConnectTimeout(500);
 
             if (connection.getOutputStream() != null) {
                 //Send message
@@ -113,7 +114,7 @@ public class ChannelJobService {
                 wr.writeBytes(urlParameters);
                 wr.close();
             } else {
-                LOGGER.log(Level.WARNING, "Channel Failed to connect to Broker.");
+                throw new Exception();
             }
 
             if (LOGGER.isLoggable(Level.INFO)) {