[Fusionforge-commits] FusionForge branch feature/reactivity updated. 0a2a759114caac98fcf8cef66e5d90c791c3eb38

Sylvain Beucler beuc-inria at fusionforge.org
Wed Jan 14 15:59:45 CET 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, feature/reactivity has been updated
       via  0a2a759114caac98fcf8cef66e5d90c791c3eb38 (commit)
       via  9b81a9a7f4cb84d7c53265de05d7f3a24a0d5f76 (commit)
       via  5d18aa27fe8fb418662fa43b68a703827ece6d1a (commit)
       via  0c486492af7c6f7fe088aeab81086b9d6180311c (commit)
       via  1ee42d4dbf0dfdb6634610c15150fa94fe3c6d4c (commit)
       via  12444679b4266dcf6e7f4478b9352070fa670a91 (commit)
       via  8e623a8692ca0c80807cfc402944a61312b10701 (commit)
      from  f2f017021a11b36bf76e428bf392f0eaa3af286c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0a2a759114caac98fcf8cef66e5d90c791c3eb38
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Wed Jan 14 15:56:32 2015 +0100

    reactivity: indent (fix double-tab issue with emacs 24.4.1)

diff --git a/src/bin/systasksd b/src/bin/systasksd
index 07daa44..1dcdb39 100755
--- a/src/bin/systasksd
+++ b/src/bin/systasksd
@@ -31,39 +31,39 @@ require_once $gfcommon.'include/cron_utils.php';
 // Invalidate users/groups cache e.g. when a user is added to a group
 // Special-case in 'publish-subscribe' mode
 function usergroups_sync() {
-		global $usergroups_lastsync;
-		$res = db_query_params("SELECT MAX(last_modified_date) AS lastmodified FROM nss_usergroups");
-		$row = db_fetch_array($res);
-		if ($row['lastmodified'] > $usergroups_lastsync) {
-				cron_reload_nscd();
-				cron_reload_apache();
-				$hook_params = array();
-				plugin_hook("usergroups_sync", $hook_params);
-				$usergroups_lastsync = time();
-		}
+	global $usergroups_lastsync;
+	$res = db_query_params("SELECT MAX(last_modified_date) AS lastmodified FROM nss_usergroups");
+	$row = db_fetch_array($res);
+	if ($row['lastmodified'] > $usergroups_lastsync) {
+		cron_reload_nscd();
+		cron_reload_apache();
+		$hook_params = array();
+		plugin_hook("usergroups_sync", $hook_params);
+		$usergroups_lastsync = time();
+	}
 }
 
 function systask_get_script($plugin_id, $systask_type_id) {
-		global $cron_arr;
-		if ($plugin_id == null) {
-				if (isset($cron_arr[$systask_type_id]))
-						return forge_get_config('source_path')
-								.'/cronjobs/'.$cron_arr[$systask_type_id];
-		} else {
-				global $pm;
-				$plugins = $pm->GetPlugins();  // reload in case a new plugin was installed
-				if (isset($plugins[$plugin_id])) {
-					$plugin = $pm->GetPluginObject($plugins[$plugin_id]);
-					if ($plugin == null) {
-						$pm->LoadPlugin($plugins[$plugin_id]);
-						$plugin = $pm->GetPluginObject($plugins[$plugin_id]);
-					}
-					if (isset($plugin->systask_types[$systask_type_id]))
-						return forge_get_config('plugins_path')."/".$plugin->GetName()
-							."/cronjobs/".$plugin->systask_types[$systask_type_id];
-				}
+	global $cron_arr;
+	if ($plugin_id == null) {
+		if (isset($cron_arr[$systask_type_id]))
+			return forge_get_config('source_path')
+				.'/cronjobs/'.$cron_arr[$systask_type_id];
+	} else {
+		global $pm;
+		$plugins = $pm->GetPlugins();  // reload in case a new plugin was installed
+		if (isset($plugins[$plugin_id])) {
+			$plugin = $pm->GetPluginObject($plugins[$plugin_id]);
+			if ($plugin == null) {
+				$pm->LoadPlugin($plugins[$plugin_id]);
+				$plugin = $pm->GetPluginObject($plugins[$plugin_id]);
+			}
+			if (isset($plugin->systask_types[$systask_type_id]))
+				return forge_get_config('plugins_path')."/".$plugin->GetName()
+					."/cronjobs/".$plugin->systask_types[$systask_type_id];
 		}
-		return null;
+	}
+	return null;
 }
 
 
@@ -104,46 +104,46 @@ $pm = plugin_manager_get_object();
 
 usergroups_sync();
 while (true) {
-		// Deal with pending requests
-		$res = db_query_params("SELECT * FROM systasks WHERE status=$1"
-		                       . " ORDER BY systask_id", array('TODO'));
-		if (!$res && !db_connection_status())
-			db_reconnect();
-		while ($arr = db_fetch_array($res)) {
-				usergroups_sync();
-				$script = systask_get_script($arr['plugin_id'], $arr['systask_type_id']);
-				if (!file_exists($script))
-						// Not installed on this node, skipping
-						continue;
-				if (!is_executable($script)) {
-						db_query_params("UPDATE systasks SET status=$1, error_message=$2"
-										. " WHERE systask_id=$3",
-										array('ERROR',
-											  "Cron job {$arr['plugin_id']}/{$arr['systask_type_id']}"
-											  . " '$script' not executable.\n",
-											  $arr['systask_id']));
-						continue;
-				}
-				db_query_params("UPDATE systasks SET status=$1 WHERE systask_id=$2",
-								array('WIP', $arr['systask_id']));
-				cron_acquire_lock($script);
-				$ret = null;
-				if ($verbose) print "Running: $script... ";
-				system("$script\n", $ret);
-				if ($ret == 0) {
-						if ($verbose) print "DONE\n";
-						db_query_params("UPDATE systasks SET status=$1 WHERE systask_id=$2",
-										array('DONE', $arr['systask_id']));
-				} else {
-						if ($verbose) print "ERROR\n";
-						db_query_params("UPDATE systasks SET status=$1 WHERE systask_id=$2",
-										array('ERROR', $arr['systask_id']));
-				}
-		}
-
+	// Deal with pending requests
+	$res = db_query_params("SELECT * FROM systasks WHERE status=$1"
+						   . " ORDER BY systask_id", array('TODO'));
+	if (!$res && !db_connection_status())
+		db_reconnect();
+	while ($arr = db_fetch_array($res)) {
 		usergroups_sync();
-
-		sleep(1);
+		$script = systask_get_script($arr['plugin_id'], $arr['systask_type_id']);
+		if (!file_exists($script))
+			// Not installed on this node, skipping
+			continue;
+		if (!is_executable($script)) {
+			db_query_params("UPDATE systasks SET status=$1, error_message=$2"
+							. " WHERE systask_id=$3",
+							array('ERROR',
+								  "Cron job {$arr['plugin_id']}/{$arr['systask_type_id']}"
+								  . " '$script' not executable.\n",
+								  $arr['systask_id']));
+			continue;
+		}
+		db_query_params("UPDATE systasks SET status=$1 WHERE systask_id=$2",
+						array('WIP', $arr['systask_id']));
+		cron_acquire_lock($script);
+		$ret = null;
+		if ($verbose) print "Running: $script... ";
+		system("$script\n", $ret);
+		if ($ret == 0) {
+			if ($verbose) print "DONE\n";
+			db_query_params("UPDATE systasks SET status=$1 WHERE systask_id=$2",
+							array('DONE', $arr['systask_id']));
+		} else {
+			if ($verbose) print "ERROR\n";
+			db_query_params("UPDATE systasks SET status=$1 WHERE systask_id=$2",
+							array('ERROR', $arr['systask_id']));
+		}
+	}
+	
+	usergroups_sync();
+	
+	sleep(1);
 }
 
 // Local Variables:

commit 9b81a9a7f4cb84d7c53265de05d7f3a24a0d5f76
Merge: 5d18aa2 0c48649
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Wed Jan 14 15:50:18 2015 +0100

    Merge branch 'master' into feature/reactivity


commit 5d18aa27fe8fb418662fa43b68a703827ece6d1a
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Wed Jan 14 15:49:54 2015 +0100

    reactivity: systasksd now loads newly installed plugins (2)

diff --git a/src/bin/systasksd b/src/bin/systasksd
index 7641b22..07daa44 100755
--- a/src/bin/systasksd
+++ b/src/bin/systasksd
@@ -53,10 +53,14 @@ function systask_get_script($plugin_id, $systask_type_id) {
 				global $pm;
 				$plugins = $pm->GetPlugins();  // reload in case a new plugin was installed
 				if (isset($plugins[$plugin_id])) {
+					$plugin = $pm->GetPluginObject($plugins[$plugin_id]);
+					if ($plugin == null) {
+						$pm->LoadPlugin($plugins[$plugin_id]);
 						$plugin = $pm->GetPluginObject($plugins[$plugin_id]);
-						if (isset($plugin->systask_types[$systask_type_id]))
-								return forge_get_config('plugins_path')."/".$plugin->GetName()
-										."/cronjobs/".$plugin->systask_types[$systask_type_id];
+					}
+					if (isset($plugin->systask_types[$systask_type_id]))
+						return forge_get_config('plugins_path')."/".$plugin->GetName()
+							."/cronjobs/".$plugin->systask_types[$systask_type_id];
 				}
 		}
 		return null;

commit 12444679b4266dcf6e7f4478b9352070fa670a91
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Wed Jan 14 14:39:16 2015 +0100

    reactivity: add missing require

diff --git a/src/common/include/SCMPlugin.class.php b/src/common/include/SCMPlugin.class.php
index 81e17b6..2c82d1b 100644
--- a/src/common/include/SCMPlugin.class.php
+++ b/src/common/include/SCMPlugin.class.php
@@ -23,6 +23,7 @@
  */
 
 require_once $gfcommon.'include/scm.php';
+require_once $gfcommon.'include/SysTasksQ.class.php';
 
 abstract class SCMPlugin extends Plugin {
 	/**

-----------------------------------------------------------------------

Summary of changes:
 autoinstall/install.sh                 |    3 -
 autoinstall/run-testsuite.sh           |    4 +
 src/bin/systasksd                      |  132 ++++++++++++++++----------------
 src/common/include/SCMPlugin.class.php |    1 +
 tests/buildbot/lxc/lxc-wrapper         |   16 ++--
 tests/func/db_reload.sh                |   53 +++++++++----
 6 files changed, 118 insertions(+), 91 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list