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
<img alt="0001-Ticket-100-Add-ENV-var-for-preserving-core-files.patch" src="/lib389/issue/raw/files/520cb8277ae20eff1f5b791976d696d32481bb4e79a3ea111210c17324e405fc-0001-Ticket-100-Add-ENV-var-for-preserving-core-files.patch" />
Metadata Update from @mreynolds: - Custom field Origin adjusted to None - Custom field Review Status adjusted to review
Revised patch to catch IO errors when copying file
<img alt="0001-Ticket-100-Add-ENV-var-for-preserving-core-files.patch" src="/lib389/issue/raw/files/b3226661ff80e1253908fa74aef8603b25eb06c6179b52bf1902eb1968bc7621-0001-Ticket-100-Add-ENV-var-for-preserving-core-files.patch" />
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)
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)
Login to comment on this ticket.