Ver Fonte

dispatcher: add new probing_mode=3 to always probe flagged gateways

   - added DS_PROBE_ONLYFLAGGED probing_mode option.  If set,
     any gateways with a state of PROBING will be continually
     probed and the PROBING flag will never be cleared.  This
     allows probing specific gateways continually, keeping
     their up/down status current.
root há 10 anos atrás
pai
commit
65a442a2ab

+ 8 - 2
modules/dispatcher/README

@@ -688,8 +688,14 @@ Note
    Controls what gateways are tested to see if they are reachable. If set
    to 0, only the gateways with state PROBING are tested; if set to 1, all
    gateways are tested; if set to 2, only gateways in inactive state with
-   probing mode set are tested. If set to 1 and there is a failure of
-   keepalive to an active gateway, then it is set to TRYING state.
+   probing mode set are tested. 
+
+   If set to 3, any gateway with a PROBING state is continually probed without 
+   modifying/removing the PROBING state flag.  This allows selected gateways to 
+   be probed continually, regardless of state chagnes.
+
+   If set to 1 and there is a failure of keepalive to an active gateway, then it 
+   is set to TRYING state.
 
    Default value is "0".
 

+ 3 - 1
modules/dispatcher/dispatch.c

@@ -2753,8 +2753,10 @@ static void ds_options_callback( struct cell *t, int type,
 	{
 		/* Set the according entry back to "Active" */
 		state = 0;
-		if (ds_probing_mode==DS_PROBE_ALL)
+		if (ds_probing_mode==DS_PROBE_ALL || 
+                    (ds_probing_mode == DS_PROBE_ONLYFLAGGED && ds_get_state(group, &uri) & DS_PROBING_DST))
 			state |= DS_PROBING_DST;
+
 		/* Check if in the meantime someone disabled the target through RPC or MI */
 		if (!(ds_get_state(group, &uri) & DS_DISABLED_DST) && ds_update_state(fmsg, group, &uri, state) != 0)
 		{

+ 1 - 0
modules/dispatcher/dispatch.h

@@ -48,6 +48,7 @@
 #define DS_PROBE_NONE		0
 #define DS_PROBE_ALL		1
 #define DS_PROBE_INACTIVE	2
+#define DS_PROBE_ONLYFLAGGED	3
 
 #define DS_MATCH_ALL		0
 #define DS_MATCH_NOPORT		1