#100 Preserve core files with new ENV variable
Closed: Invalid 6 years ago Opened 6 years ago by mreynolds.

When running automated tests sometimes there are random crashes, but the core files are not preserved unless the tests are run in "DEBUGGING" mode.

I'm proposing we add a new ENV variable to "preserve" core files, then in the topology "finalizer" can check for core files and place them somewhere so they are not lost , perhaps use the value of the ENV var as the core file location:

PRESERVE_CORE=/tmp py.test

def fin:
    if PRESERVER_CORE:
        # Check for core file in logs dir
        if core_file_found:
            # Rename core file to "nsslapd_TEST_NAME_TIMESTAMP.core"
            # Copy renamed core to PRESERVE_CORE dir

    # The other/original finalizer code

Metadata Update from @mreynolds:
- Issue assigned to mreynolds

6 years ago

Metadata Update from @mreynolds:
- Custom field Origin adjusted to None
- Custom field Review Status adjusted to review

6 years ago

I'm okay with this, but it does depend on your kernels core dump settings. So maybe we need some documenation about what that should be set to in /sys.

Metadata Update from @firstyear:
- Custom field Review Status adjusted to ack (was: review)

6 years ago

I'm okay with this, but it does depend on your kernels core dump settings. So maybe we need some documenation about what that should be set to in /sys.

By default 389 puts the cores in the logs dir. This is really just for our nightly tests - we need something to save cores in between different test runs.

Actually I just realized I also wanted to add the test script name to the new/moved corefile name. So I'm going to work on a follow up patch - if there is something else you want changed speak up now :-)

cat /proc/sys/kernel/core_pattern

^ check your value for this, because this is system wide, not application specific. You may need a setup env for this,

Code looks good to me and works.

One issue with the docstring. As we document everything now, we need it to be in one format and the format should be compatible with Sphinx. Could you please fix it to this?

"""Check the logs directory of every instance, and rename and copy all
core files to the preservation location

:param instances: Dictionary of instances to look for cores
:type instances: {str: lib389.DirSrv}
:returns: None
"""

This ticket is invalid. Core files are not placed in the logs directory -so this feature is not needed

Metadata Update from @mreynolds:
- Issue close_status updated to: Invalid
- Issue status updated to: Closed (was: Open)

6 years ago

Login to comment on this ticket.

Metadata