From: Sylvain Beucler Date: Mon, 2 Nov 2015 11:07:25 +0000 (+0100) Subject: systasksd: fix another race condition by flushing nscd cache after the nss_groups... X-Git-Tag: 6.0.4~82 X-Git-Url: https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge%2Ffusionforge.git;a=commitdiff_plain;h=1c0f2ceda34d746a4db6ae9e46e2562a620316bd;ds=sidebyside systasksd: fix another race condition by flushing nscd cache after the nss_groups check --- diff --git a/src/CHANGES b/src/CHANGES index 0fa454d574..eda17945b9 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -2,6 +2,7 @@ FusionForge 6.0.4: * Accounts: do not accept digits-only user and group names, to avoid confusion with UID/GID in system commands (Inria) * MTA-Exim4: restart exim4 on install * Plugin SCM: improve user matching when computing stats (Inria) +* Plugin SCM: fix another race condition when creating project with SCM selected (Inria) * Plugin scmhook: fix non-editable mailing list name in some configurations (Inria) * Plugin MediaWiki: fix permission error when upgrading suspended projects database (Inria & TrivialDev) * Plugin Projects Hierarchy: don't display a project as possible child if there's no read access to it (Inria) diff --git a/src/bin/systasksd b/src/bin/systasksd index 7de8533514..c0b0967f35 100755 --- a/src/bin/systasksd +++ b/src/bin/systasksd @@ -123,7 +123,6 @@ while (true) { 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']); if (!file_exists($script)) // Not installed on this node, skipping @@ -137,9 +136,13 @@ while (true) { $arr['systask_id'])); continue; } + + // Concurrency: ensure groups are activated in the system before starting task if (!empty($arr['group_id']) && !is_group_active_nocache($arr['group_id'])) { continue; // wait until project is approved } + usergroups_sync(); + db_query_params("UPDATE systasks SET status=$1, started=now() WHERE systask_id=$2", array('WIP', $arr['systask_id'])); cron_acquire_lock($script);