This is an automated email from the git hooks/post-receive script.
tbordaz pushed a commit to branch 389-ds-base-1.3.8
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.3.8 by this push:
new 26517ea Ticket 50177 - import task should not be deleted too rapidely after
import finishes to be able to query the status
26517ea is described below
commit 26517eadf066f34b4fb75527a1a439cbaba258e1
Author: Thierry Bordaz <tbordaz(a)redhat.com>
AuthorDate: Fri Feb 1 15:36:01 2019 +0100
Ticket 50177 - import task should not be deleted too rapidely after import finishes to
be able to query the status
Bug Description:
scripts that create online import and export tasks do not define a Time To Life of
the tasks.
As a consequence the task entry is cleared 2min (default value) after task
completion.
This is too rapid and some admin scripts may miss the final task status.
Fix Description:
The fix is to keep the entry of completed online import and export tasks for 1 day.
It also allows defines a default TTL to 1h (instead of 2min)
https://pagure.io/389-ds-base/issue/50177
Reviewed by: Mark Reynolds
Platforms tested: F27
Flag Day: no
Doc impact: no
---
ldap/admin/src/scripts/db2ldif.pl.in | 3 ++-
ldap/admin/src/scripts/ldif2db.pl.in | 3 ++-
ldap/servers/slapd/task.c | 6 +++---
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/ldap/admin/src/scripts/db2ldif.pl.in b/ldap/admin/src/scripts/db2ldif.pl.in
index 0d220f0..f7d12b4 100644
--- a/ldap/admin/src/scripts/db2ldif.pl.in
+++ b/ldap/admin/src/scripts/db2ldif.pl.in
@@ -241,7 +241,8 @@ if ($decrypt_on_export != 0) { $nsexportdecrypt =
"nsExportDecrypt: true\n"; }
$nsprintkey = "";
if ($printkey == 0) { $nsprintkey = "nsPrintKey: false\n"; }
$nsldiffile = "nsFilename: ${ldiffile}\n";
-$entry =
"${dn}${misc}${cn}${nsinstance}${nsincluded}${nsexcluded}${nsreplica}${nsnobase64}${nsnowrap}${nsnoversion}${nsnouniqueid}${nsuseid2entry}${nsonefile}${nsexportdecrypt}${nsprintkey}${nsldiffile}";
+$ttl = "ttl: 86400";
+$entry =
"${dn}${misc}${cn}${nsinstance}${nsincluded}${nsexcluded}${nsreplica}${nsnobase64}${nsnowrap}${nsnoversion}${nsnouniqueid}${nsuseid2entry}${nsonefile}${nsexportdecrypt}${nsprintkey}${nsldiffile}${ttl}";
print("Exporting to ldif file: ${ldiffile}\n");
$rc = DSUtil::ldapmod($entry, %info);
diff --git a/ldap/admin/src/scripts/ldif2db.pl.in b/ldap/admin/src/scripts/ldif2db.pl.in
index a5d834f..486dcd0 100644
--- a/ldap/admin/src/scripts/ldif2db.pl.in
+++ b/ldap/admin/src/scripts/ldif2db.pl.in
@@ -192,7 +192,8 @@ $nsmergechunksiz = "nsImportChunkSize: ${mergechunksiz}\n";
$nsgenuniqid = "nsUniqueIdGenerator: ${genuniqid}\n";
$nsuniqidname = "";
if ($uniqidname ne "") { $nsuniqidname = "nsUniqueIdGeneratorNamespace:
${uniqidname}\n"; }
-$entry =
"${dn}${misc}${cn}${nsinstance}${nsincluded}${nsexcluded}${nsldiffiles}${nsnoattrindexes}${nsimportencrypt}${nsmergechunksiz}${nsgenuniqid}${nsuniqidname}";
+$ttl = "ttl: 86400";
+$entry =
"${dn}${misc}${cn}${nsinstance}${nsincluded}${nsexcluded}${nsldiffiles}${nsnoattrindexes}${nsimportencrypt}${nsmergechunksiz}${nsgenuniqid}${nsuniqidname}${ttl}";
$rc = DSUtil::ldapmod($entry, %info);
diff --git a/ldap/servers/slapd/task.c b/ldap/servers/slapd/task.c
index 0cf0cd7..80a2383 100644
--- a/ldap/servers/slapd/task.c
+++ b/ldap/servers/slapd/task.c
@@ -46,7 +46,7 @@ static int shutting_down = 0;
#define TASK_PROGRESS_NAME "nsTaskCurrentItem"
#define TASK_WORK_NAME "nsTaskTotalItems"
-#define DEFAULT_TTL "120" /* seconds */
+#define DEFAULT_TTL "3600" /* seconds */
#define TASK_SYSCONFIG_FILE_ATTR "sysconfigfile" /* sysconfig reload task file
attr */
#define TASK_SYSCONFIG_LOGCHANGES_ATTR "logchanges"
#define TASK_TOMBSTONE_FIXUP "fixup tombstones task"
@@ -387,8 +387,8 @@ slapi_task_status_changed(Slapi_Task *task)
if (e == NULL)
return;
ttl = atoi(slapi_fetch_attr(e, "ttl", DEFAULT_TTL));
- if (ttl > 3600)
- ttl = 3600; /* be reasonable. */
+ if (ttl > (24*3600))
+ ttl = (24*3600); /* be reasonable, allow to check task status not longer than
one day */
expire = time(NULL) + ttl;
task->task_flags |= SLAPI_TASK_DESTROYING;
/* queue an event to destroy the state info */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.