Browse Source

Merge pull request #10162 from jakesmith/hpcc-17818

HPCC-17818 Make debug port based on Thor port bases.

Reviewed By: Shamser Ahmed <shamser.ahmed@lexisnexis.co.uk>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 8 years ago
parent
commit
95180f376e

+ 0 - 1
system/include/portlist.h

@@ -97,7 +97,6 @@
 #define ROXIE_SERVER_PORT               9876
 #define ROXIE_SSL_SERVER_PORT           19876
 
-#define THOR_DEBUG_PORT                 16000
 #define HTHOR_DEBUG_BASE_PORT           17000
 #define HTHOR_DEBUG_PORT_RANGE          10
 

+ 2 - 1
thorlcr/master/thgraphmanager.cpp

@@ -78,7 +78,8 @@ class CJobManager : public CSimpleInterface, implements IJobManager, implements
     public:
         CThorDebugListener(CJobManager &_mgr) : threaded("CThorDebugListener", this), mgr(_mgr)
         {
-            port = globals->getPropInt("DebugPort", THOR_DEBUG_PORT);
+            unsigned defaultThorDebugPort = getFixedPort(getMasterPortBase(), TPORT_debug);
+            port = globals->getPropInt("DebugPort", defaultThorDebugPort);
             running = true;
             threaded.start();
         }

+ 4 - 0
thorlcr/thorutil/thorport.cpp

@@ -37,6 +37,7 @@
 
 #define MPPORT       0
 #define WATCHDOGPORT 1
+#define DEBUGPORT 2
 
 static CriticalSection *portallocsection;
 static IBitSet *portmap;
@@ -46,6 +47,7 @@ MODULE_INIT(INIT_PRIORITY_STANDARD)
     portmap = createThreadSafeBitSet();
     portmap->set(MPPORT, true);
     portmap->set(WATCHDOGPORT, true);
+    portmap->set(DEBUGPORT, true);
     return true;
 }
 MODULE_EXIT()
@@ -77,6 +79,8 @@ unsigned short getExternalFixedPort(unsigned short masterBase, unsigned short ma
         return machineBase+WATCHDOGPORT;
     case TPORT_mp:
         return machineBase+MPPORT; 
+    case TPORT_debug:
+        return machineBase+DEBUGPORT;
     }
     LOG(MCerror,unknownJob,"getFixedPort: Unknown Port Kind!");
     return 0;

+ 2 - 1
thorlcr/thorutil/thorport.hpp

@@ -31,7 +31,8 @@
 enum ThorPortKind
 {
     TPORT_watchdog,
-    TPORT_mp
+    TPORT_mp,
+    TPORT_debug
 };
 
 graph_decl unsigned short getFixedPort(ThorPortKind category);