Option for automatic proxy purge. Disabled by default now.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 17 Feb 2010 15:45:22 +0000 (15:45 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 17 Feb 2010 15:45:22 +0000 (15:45 +0000)
org.glite.lb.server/doc/glite-lb-bkserverd.8
org.glite.lb.server/src/bkindex.c
org.glite.lb.server/src/bkserverd.c
org.glite.lb.server/src/db_store.c
org.glite.lb.server/src/mon-db.c

index 94066c6..eca823e 100644 (file)
@@ -260,6 +260,10 @@ Socket to send events to.
 .BI -Z\fR,\fP --proxy-il-fprefix
 File prefix for events.
 
+.TP
+.BI -G\fR,\fP --proxy-purge
+Enable automatic purging of the jobs in terminal state for proxy service (disabled by default).
+
 .\".SH USAGE
 .\" Add any additional description here
 
index 62e3ff0..0c88410 100644 (file)
@@ -28,6 +28,7 @@ enum lb_srv_perf_sink sink_mode;
 /* XXX: referenced global variables, unsed in bkindex */
 char   *server_key,*server_cert;
 int    enable_lcas;
+int    proxy_purge;
 
 static struct option opts[] = {
        { "mysql",1,NULL,'m' },
index 1fea604..7c149bc 100644 (file)
@@ -151,6 +151,7 @@ static char                         *server_subject = NULL;
 static time_t                  purge_timeout[EDG_WLL_NUMBER_OF_STATCODES];
 static time_t                  notif_duration_max = 60*60*24,
                                notif_duration = 60*60*2;
+int                            proxy_purge = 0;
 
 static edg_wll_GssCred mycred = NULL;
 time_t                                 cert_mtime = 0;
@@ -212,11 +213,12 @@ static struct option opts[] = {
        {"con-queue",   1,      NULL,   'q'},
        {"proxy-il-sock",       1,      NULL,   'W'},
        {"proxy-il-fprefix",    1,      NULL,   'Z'},
+       {"proxy-purge", 0,      NULL,   'G'},
        {"rss-time",    1,      NULL,   'I'},
        {NULL,0,NULL,0}
 };
 
-static const char *get_opt_string = "Ac:k:C:V:p:a:drm:ns:i:S:D:J:jR:F:xOL:N:X:Y:T:t:zb:gPBo:q:W:Z:I:"
+static const char *get_opt_string = "Ac:k:C:V:p:a:drm:ns:i:S:D:J:jR:F:xOL:N:X:Y:T:t:zb:gPBo:q:W:Z:GI:"
 #ifdef GLITE_LB_SERVER_WITH_WS
        "w:"
 #endif
@@ -272,6 +274,7 @@ static void usage(char *me)
                "\t-q,--con-queue\t size of the connection queue (accept)\n"
                "\t-W,--proxy-il-sock\t socket to send events to\n"
                "\t-Z,--proxy-il-fprefix\t file prefix for events\n"
+               "\t-G,--proxy-purge\t enable automatic purge on proxy service (disabled by default)\n"
                "\t-I,--rss-time age\t (in seconds) of job states published via RSS\n"
 
        ,me);
@@ -476,6 +479,8 @@ int main(int argc, char *argv[])
                          break;
                case 'Z': lbproxy_ilog_file_prefix = strdup(optarg);
                          break;
+               case 'G': proxy_purge = 1;
+                         break;
                case 'I': rss_time = atol(optarg);
                          break;
                case '?': usage(name); return 1;
index 54cbcf0..fc28eda 100644 (file)
@@ -25,6 +25,7 @@
 
 extern int unset_proxy_flag(edg_wll_Context, edg_wlc_JobId);
 extern int enable_lcas;
+extern int proxy_purge;
 
 
 static int db_store_finalize(edg_wll_Context ctx, char *event, edg_wll_Event *ev, edg_wll_JobStat *oldstat, edg_wll_JobStat *newstat, int reg_to_JP);
@@ -95,7 +96,7 @@ db_store(edg_wll_Context ctx, char *event)
                }
                if (edg_wll_StepIntState(ctx,ev->any.jobId, ev, seq, &oldstat, &newstat)) goto rollback;
                
-               if (newstat.remove_from_proxy) 
+               if (proxy_purge && newstat.remove_from_proxy) 
                        if (edg_wll_PurgeServerProxy(ctx, ev->any.jobId)) goto rollback;
        }
 
index 553fc50..6c93c45 100644 (file)
@@ -24,6 +24,7 @@ enum lb_srv_perf_sink sink_mode;
 /* XXX: referenced global variables, unsed in mon */
 char   *server_key,*server_cert;
 int    enable_lcas;
+int    proxy_purge;
 
 static struct option opts[] = {
        { "mysql",1,NULL,'m' },