This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.3.8
in repository 389-ds-base.
commit de73f4f6d492b43c42170edb8c375b7fb25d4cb4
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Tue Jan 15 13:55:18 2019 -0500
Ticket 49540 - FIx compiler warning in ldif2ldbm
https://pagure.io/389-ds-base/issue/49540
Reviewed by: mreynolds(one line commit rule)
(cherry picked from commit 58be90b8bf96a7a0e10740b122035ea03fa13e0f)
(cherry picked from commit c9580477ffe22a08c0094378e81a6927d0dc4ffc)
---
ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
index 69a2af9..11c020a 100644
--- a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
+++ b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
@@ -713,7 +713,7 @@ ldbm_back_ldif2ldbm(Slapi_PBlock *pb)
uint64_t refcnt;
refcnt = slapi_counter_get_value(inst->inst_ref_count);
if (refcnt > 0) {
- slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldif2ldbm", "ldbm: '%s' there are %d pending operation(s)."
+ slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldif2ldbm", "ldbm: '%s' there are %" PRIu64 " pending operation(s)."
" Import can not proceed until they are completed.\n",
inst->inst_name,
refcnt);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.3.8
in repository 389-ds-base.
commit a56280287432406fd8258bf7ba1617c891a507b1
Author: Thierry Bordaz <tbordaz(a)redhat.com>
AuthorDate: Fri Jan 4 12:24:56 2019 +0100
Ticket 50117 - after certain failed import operation, impossible to replay an import operation
Bug Description:
At the beginning of an import, a flag is set to mark the target backend is busy.
Then import tests if there are pending operations. If such operations exist the import can not proceed and fails.
The problem is that in such case of pending operations, the import fails without resetting the busy flag.
It let the backend busy (until next reboot) and prevent new import.
Fix Description:
It needs to reset the busy flag if there are pending operations
https://pagure.io/389-ds-base/issue/50117
Reviewed by: Mark Reynolds, William Brown
Platforms tested: F27
Flag Day: no
Doc impact: no
(cherry picked from commit ff00b07402747aac403478a157adab75e306d7d1)
(cherry picked from commit 630940ec119a90c3bbfc7cd3464eb02ab779b474)
---
ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
index 16b87ee..69a2af9 100644
--- a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
+++ b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
@@ -704,12 +704,22 @@ ldbm_back_ldif2ldbm(Slapi_PBlock *pb)
}
/* check if an import/restore is already ongoing... */
- if ((instance_set_busy(inst) != 0) ||
- (slapi_counter_get_value(inst->inst_ref_count) > 0)) {
+ if ((instance_set_busy(inst) != 0)) {
slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldif2ldbm", "ldbm: '%s' is already in the middle of "
"another task and cannot be disturbed.\n",
inst->inst_name);
return -1;
+ } else {
+ uint64_t refcnt;
+ refcnt = slapi_counter_get_value(inst->inst_ref_count);
+ if (refcnt > 0) {
+ slapi_log_err(SLAPI_LOG_ERR, "ldbm_back_ldif2ldbm", "ldbm: '%s' there are %d pending operation(s)."
+ " Import can not proceed until they are completed.\n",
+ inst->inst_name,
+ refcnt);
+ instance_set_not_busy(inst);
+ return -1;
+ }
}
if ((task_flags & SLAPI_TASK_RUNNING_FROM_COMMANDLINE)) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
This is an automated email from the git hooks/post-receive script.
tbordaz pushed a commit to branch 389-ds-base-1.4.0
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.0 by this push:
new 6f87fab Ticket 49873 - Contention on virtual attribute lookup
6f87fab is described below
commit 6f87fab42db4bf084c4d9fa32897e7175ba1ef82
Author: Thierry Bordaz <tbordaz(a)redhat.com>
AuthorDate: Tue Jan 15 11:13:42 2019 +0100
Ticket 49873 - Contention on virtual attribute lookup
Bug Description:
During lookup of the virtual attribute table (filter evaluation and returned attribute)
the lock is acquired many times in read. For example it is acquired for each targetfilter aci and for
each evaluated entry.
Unfortunately RW lock is expensive and appears frequently on pstacks.
The lock exists because the table can be updated but update is very rare (addition of a new service provider).
So it slows down general proceeding for exceptional events.
Fix Description:
The fix is to acquire/release the read lock at the operation level and set a per-cpu flag, so that later lookup
would just check the flag.
https://pagure.io/389-ds-base/issue/49873
Reviewed by: Ludwig Krispenz, William Brown (thanks !!)
Platforms tested: F27
Flag Day: no
Doc impact: no
---
ldap/servers/slapd/connection.c | 1 +
ldap/servers/slapd/opshared.c | 6 +++
ldap/servers/slapd/proto-slap.h | 3 ++
ldap/servers/slapd/psearch.c | 1 +
ldap/servers/slapd/vattr.c | 82 ++++++++++++++++++++++++++++++++++-------
5 files changed, 80 insertions(+), 13 deletions(-)
diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c
index 8b88568..fcc46cd 100644
--- a/ldap/servers/slapd/connection.c
+++ b/ldap/servers/slapd/connection.c
@@ -1509,6 +1509,7 @@ connection_threadmain()
long bypasspollcnt = 0;
enable_nunc_stans = config_get_enable_nunc_stans();
+ vattr_global_lock_init();
#if defined(hpux)
/* Arrange to ignore SIGPIPE signals. */
SIGNAL(SIGPIPE, SIG_IGN);
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index e791a90..8b895a1 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -243,6 +243,7 @@ op_shared_search(Slapi_PBlock *pb, int send_result)
int pr_idx = -1;
Slapi_DN *orig_sdn = NULL;
int free_sdn = 0;
+ PRBool vattr_lock_acquired = PR_FALSE;
be_list[0] = NULL;
referral_list[0] = NULL;
@@ -528,6 +529,8 @@ op_shared_search(Slapi_PBlock *pb, int send_result)
}
slapi_pblock_set(pb, SLAPI_BACKEND_COUNT, &index);
+ vattr_rdlock();
+ vattr_lock_acquired = PR_TRUE;
if (be) {
slapi_pblock_set(pb, SLAPI_BACKEND, be);
@@ -983,6 +986,9 @@ free_and_return:
} else if (be_single) {
slapi_be_Unlock(be_single);
}
+ if (vattr_lock_acquired) {
+ vattr_unlock();
+ }
free_and_return_nolock:
slapi_pblock_set(pb, SLAPI_PLUGIN_OPRETURN, &rc);
diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h
index ca946fb..2029f41 100644
--- a/ldap/servers/slapd/proto-slap.h
+++ b/ldap/servers/slapd/proto-slap.h
@@ -1419,6 +1419,9 @@ void subentry_create_filter(Slapi_Filter **filter);
* vattr.c
*/
void vattr_init(void);
+void vattr_global_lock_init(void);
+void vattr_rdlock();
+void vattr_unlock();
void vattr_cleanup(void);
/*
diff --git a/ldap/servers/slapd/psearch.c b/ldap/servers/slapd/psearch.c
index 8ad268a..e7b97a7 100644
--- a/ldap/servers/slapd/psearch.c
+++ b/ldap/servers/slapd/psearch.c
@@ -267,6 +267,7 @@ ps_send_results(void *arg)
Operation *pb_op = NULL;
g_incr_active_threadcnt();
+ vattr_global_lock_init();
slapi_pblock_get(ps->ps_pblock, SLAPI_CONNECTION, &pb_conn);
slapi_pblock_get(ps->ps_pblock, SLAPI_OPERATION, &pb_op);
diff --git a/ldap/servers/slapd/vattr.c b/ldap/servers/slapd/vattr.c
index f7c473a..155afca 100644
--- a/ldap/servers/slapd/vattr.c
+++ b/ldap/servers/slapd/vattr.c
@@ -102,6 +102,16 @@ int vattr_basic_sp_init();
void **statechange_api;
+struct _vattr_map
+{
+ Slapi_RWLock *lock;
+ PLHashTable *hashtable; /* Hash table */
+};
+typedef struct _vattr_map vattr_map;
+
+static vattr_map *the_map = NULL;
+static PRUintn thread_private_global_vattr_lock;
+
/* Housekeeping Functions, called by server startup/shutdown code */
/* Called on server startup, init all structures etc */
@@ -109,6 +119,7 @@ void
vattr_init()
{
statechange_api = 0;
+ PR_NewThreadPrivateIndex(&thread_private_global_vattr_lock, NULL);
vattr_map_create();
#ifdef VATTR_TEST_CODE
@@ -116,6 +127,60 @@ vattr_init()
#endif
}
+void
+vattr_global_lock_init()
+{
+ if (thread_private_global_vattr_lock) {
+ PR_SetThreadPrivate(thread_private_global_vattr_lock, (void *) 0);
+ }
+}
+/* The map lock can be acquired recursively. So only the first rdlock
+ * will acquire the lock.
+ * A optimization acquires it at high level (op_shared_search), so that
+ * later calls during the operation processing will just increase/decrease a counter.
+ */
+void
+vattr_rdlock()
+{
+ if (thread_private_global_vattr_lock) {
+ int nb_acquire = (int) PR_GetThreadPrivate(thread_private_global_vattr_lock);
+
+ if (nb_acquire == 0) {
+ /* The lock was not held just acquire it */
+ slapi_rwlock_rdlock(the_map->lock);
+ }
+ nb_acquire++;
+ PR_SetThreadPrivate(thread_private_global_vattr_lock, (void *) nb_acquire);
+ } else {
+ slapi_rwlock_rdlock(the_map->lock);
+ }
+}
+/* The map lock can be acquired recursively. So only the last unlock
+ * will release the lock.
+ * A optimization acquires it at high level (op_shared_search), so that
+ * later calls during the operation processing will just increase/decrease a counter.
+ */
+void
+vattr_unlock()
+{
+ if (thread_private_global_vattr_lock) {
+ int nb_acquire = (int) PR_GetThreadPrivate(thread_private_global_vattr_lock);
+
+ if (nb_acquire >= 1) {
+ nb_acquire--;
+ if (nb_acquire == 0) {
+ slapi_rwlock_unlock(the_map->lock);
+ }
+ PR_SetThreadPrivate(thread_private_global_vattr_lock, (void *) nb_acquire);
+ } else {
+ slapi_log_err(SLAPI_LOG_CRIT,
+ "vattr_unlock", "The lock was not acquire. We should not be here\n");
+ PR_ASSERT(nb_acquire >= 1);
+ }
+ } else {
+ slapi_rwlock_unlock(the_map->lock);
+ }
+}
/* Called on server shutdown, free all structures, inform service providers that we're going down etc */
void
vattr_cleanup()
@@ -1811,15 +1876,6 @@ typedef struct _vattr_map_entry vattr_map_entry;
vattr_map_entry test_entry = {NULL};
-struct _vattr_map
-{
- Slapi_RWLock *lock;
- PLHashTable *hashtable; /* Hash table */
-};
-typedef struct _vattr_map vattr_map;
-
-static vattr_map *the_map = NULL;
-
static PRIntn
vattr_hash_compare_keys(const void *v1, const void *v2)
{
@@ -1939,11 +1995,11 @@ vattr_map_lookup(const char *type_to_find, vattr_map_entry **result)
}
/* Get the reader lock */
- slapi_rwlock_rdlock(the_map->lock);
+ vattr_rdlock();
*result = (vattr_map_entry *)PL_HashTableLookupConst(the_map->hashtable,
(void *)basetype);
/* Release ze lock */
- slapi_rwlock_unlock(the_map->lock);
+ vattr_unlock();
if (tmp) {
slapi_ch_free_string(&tmp);
@@ -2131,7 +2187,7 @@ slapi_vattr_schema_check_type(Slapi_Entry *e, char *type)
objAttrValue *obj;
if (0 == vattr_map_lookup(type, &map_entry)) {
- slapi_rwlock_rdlock(the_map->lock);
+ vattr_rdlock();
obj = map_entry->objectclasses;
@@ -2148,7 +2204,7 @@ slapi_vattr_schema_check_type(Slapi_Entry *e, char *type)
obj = obj->pNext;
}
- slapi_rwlock_unlock(the_map->lock);
+ vattr_unlock();
}
slapi_valueset_free(vs);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
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.
This is an automated email from the git hooks/post-receive script.
tbordaz pushed a commit to branch 389-ds-base-1.3.9
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.3.9 by this push:
new 50240de Ticket 50177 - import task should not be deleted too rapidely after import finishes to be able to query the status
50240de is described below
commit 50240dea4d6772dbfa482d9335769cf0545863aa
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.
This is an automated email from the git hooks/post-receive script.
tbordaz pushed a commit to branch 389-ds-base-1.4.0
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.0 by this push:
new 98bfccc Ticket 50177 - import task should not be deleted too rapidely after import finishes to be able to query the status
98bfccc is described below
commit 98bfccc8168d021e2c1516c5042d68c12b88c7e6
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 b145176..8741570 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"
@@ -381,8 +381,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.