Simone Tiraboschi has uploaded a new change for review.

Change subject: packaging: setup: using the right type to detect zombie tasks
......................................................................

packaging: setup: using the right type to detect zombie tasks

A zombie task is task that is running since more than
AsyncTaskZombieTaskLifeInMinutes without completing.
In order to cerretly detect it we must compute the zombie
starting date as a timestamp and not as data with doesn't
include time attributes.

Change-Id: I96de0ddf6f7f8f3dcc4a8ccbefa9e43504d2c75b
Bug-Url: https://bugzilla.redhat.com/1161012
Signed-off-by: Simone Tiraboschi <stira...@redhat.com>
(cherry picked from commit 0e54ed3e19fedeb1f2229fb57f6b2906b51ecf95)
---
M packaging/setup/dbutils/taskcleaner_sp.sql
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/47/38847/1

diff --git a/packaging/setup/dbutils/taskcleaner_sp.sql 
b/packaging/setup/dbutils/taskcleaner_sp.sql
index 779930e..9305a27 100644
--- a/packaging/setup/dbutils/taskcleaner_sp.sql
+++ b/packaging/setup/dbutils/taskcleaner_sp.sql
@@ -5,14 +5,14 @@
    AS $procedure$
 DECLARE
     zombie_task_life varchar;
-    zombie_date date;
+    zombie_timestamptz timestamp with time zone;
 BEGIN
    zombie_task_life = option_value FROM vdc_options WHERE option_name = 
'AsyncTaskZombieTaskLifeInMinutes';
-   EXECUTE 'SELECT now() - interval ''' || zombie_task_life || ' minute'''  
INTO zombie_date;
+   EXECUTE 'SELECT now() - interval ''' || zombie_task_life || ' minute'''  
INTO zombie_timestamptz;
 
    RETURN QUERY SELECT *
    FROM async_tasks
-   WHERE started_at < zombie_date
+   WHERE started_at < zombie_timestamptz
    ORDER BY command_id;
 
 END; $procedure$


-- 
To view, visit https://gerrit.ovirt.org/38847
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I96de0ddf6f7f8f3dcc4a8ccbefa9e43504d2c75b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5.2
Gerrit-Owner: Simone Tiraboschi <stira...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to