#50783 Ticket 50741-cont bdb_start - Detected Disorderly Shutdown
Closed by spichugi. Opened by lkrispen.
lkrispen/389-ds-base t50741-cont  into  master

Download 50783.patch

Bug: Offline import does no longer write guardian file, next
normal start will raise a Disorderly Shutdown

Fix: The bug was introduced with the fix for #50659 when dblayer_close() was
removed from import_moain_offline becasue it was called twice in some
scenarios. But it did miss in ldif2db. Add it there.
Also correct function reference in error messages

Reviewed by: ?

write guardian file after import

I don't see any obvious issues with this, ack from me :)

Not to be nit-picket but just to take the opportunity to get familiar with the code.
SLAPI_TASK_RUNNING_FROM_COMMANDLINE is tested on task_flags but also on li_flags.
Is it supposed to be the same values ?
For example in bdb_ldif2db we read task_flags from the pblock (pblock->pb_task->task_flags) but we also read 'li' from SLAPI_PLUGIN_PRIVATE.
Could li->li_flags differs from pblock->pb_task->task_flags ? If not we may create a new ticket to converge task_flags to li_flags or the opposite

If import_main_offline() is common to online and offline import, could it be renamed (e.g. import_main_common).

Sorry I haven't looked closely at this as I'm out of town, but what about db2index, is there any risk there?

@mreynolds, as far as I can say db2index calls dblayer_close on command line. So it should not have the same issue reported in this ticket.

Not to be nit-picket but just to take the opportunity to get familiar with the code.
SLAPI_TASK_RUNNING_FROM_COMMANDLINE is tested on task_flags but also on li_flags.
Is it supposed to be the same values ?
For example in bdb_ldif2db we read task_flags from the pblock (pblock->pb_task->task_flags) but we also read 'li' from SLAPI_PLUGIN_PRIVATE.
Could li->li_flags differs from pblock->pb_task->task_flags ? If not we may create a new ticket to converge task_flags to li_flags or the opposite

I think that in a lower level where RUNNING_FROM_COMMANDLINE is checked we no longer have access to the pblock, so we need to use li_flags. But in main where the slapd mode is checked we do not have a li struct yet, so need to set task flags

If import_main_offline() is common to online and offline import, could it be renamed (e.g. import_main_common).

yes, the naming can be improved. import_main() is called for online import and then calls import_main_offline. Maybe we can rename
import_main >> import_online
import_main_offline >> import_main

rebased onto 469bc4cbc9ea1cbb12d2d06a023b80f46eb2e452

Pull-Request has been merged by lkrispen

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3838

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata