Browse code

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 authored on 24/08/2015 18:29:23
Showing 3 changed files
... ...
@@ -688,8 +688,14 @@ Note
688 688
    Controls what gateways are tested to see if they are reachable. If set
689 689
    to 0, only the gateways with state PROBING are tested; if set to 1, all
690 690
    gateways are tested; if set to 2, only gateways in inactive state with
691
-   probing mode set are tested. If set to 1 and there is a failure of
692
-   keepalive to an active gateway, then it is set to TRYING state.
691
+   probing mode set are tested. 
692
+
693
+   If set to 3, any gateway with a PROBING state is continually probed without 
694
+   modifying/removing the PROBING state flag.  This allows selected gateways to 
695
+   be probed continually, regardless of state chagnes.
696
+
697
+   If set to 1 and there is a failure of keepalive to an active gateway, then it 
698
+   is set to TRYING state.
693 699
 
694 700
    Default value is "0".
695 701
 
... ...
@@ -2753,8 +2753,10 @@ static void ds_options_callback( struct cell *t, int type,
2753 2753
 	{
2754 2754
 		/* Set the according entry back to "Active" */
2755 2755
 		state = 0;
2756
-		if (ds_probing_mode==DS_PROBE_ALL)
2756
+		if (ds_probing_mode==DS_PROBE_ALL || 
2757
+                    (ds_probing_mode == DS_PROBE_ONLYFLAGGED && ds_get_state(group, &uri) & DS_PROBING_DST))
2757 2758
 			state |= DS_PROBING_DST;
2759
+
2758 2760
 		/* Check if in the meantime someone disabled the target through RPC or MI */
2759 2761
 		if (!(ds_get_state(group, &uri) & DS_DISABLED_DST) && ds_update_state(fmsg, group, &uri, state) != 0)
2760 2762
 		{
... ...
@@ -48,6 +48,7 @@
48 48
 #define DS_PROBE_NONE		0
49 49
 #define DS_PROBE_ALL		1
50 50
 #define DS_PROBE_INACTIVE	2
51
+#define DS_PROBE_ONLYFLAGGED	3
51 52
 
52 53
 #define DS_MATCH_ALL		0
53 54
 #define DS_MATCH_NOPORT		1