Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[coredump] Add sizelimit for coredump #3810

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jcastill
Copy link
Member

While most coredumps could be relatively small,
in certain environments, like Ceph, these can be
as big as 5GB. This change adds a limit of 100MB
to the latest core collection.

Related: RHEL-62972


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname [email protected]?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?
  • Are all passwords or private data gathered by this PR obfuscated?

While most coredumps could be relatively small,
in certain environments, like Ceph, these can be
as big as 5GB. This change adds a limit of 100MB
to the latest core collection.

Related: RHEL-62972

Signed-off-by: Jose Castillo <[email protected]>
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3810
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@pmoravec
Copy link
Contributor

This would mean we grab 100MB of incomplete / usefulness data for coredumps >100MB. Not great though no idea how to simply prevent that.

@jcastill
Copy link
Member Author

OK, I thought it was "grab the file only if max is 100MB". I'll add a check then, because incomplete core dumps are useless

@jcastill
Copy link
Member Author

@pmoravec some options:
a- Stop gathering the latest coredump.
b- Increase the limit for coredumps smaller than, lets say, 500M
c- Add an option to add_cmd_output for 'max_size' that only gathers commands less than that argument?
d- Add an option 'tailit' like in add_copy_spec, so if size is bigger than sizelimit and it's a binary, skip the collection and log it?
e- Other option I didn't think about?

@TurboTurtle
Copy link
Member

OK, I thought it was "grab the file only if max is 100MB". I'll add a check then, because incomplete core dumps are useless

That's for binary files. This is a command capture.

c- Add an option to add_cmd_output for 'max_size' that only gathers commands less than that argument?
d- Add an option 'tailit' like in add_copy_spec, so if size is bigger than sizelimit and it's a binary, skip the collection and log it?

We would need to hold the entire command output in memory to determine its size, which is not desirable here. Any sizelimit that isn't 0 means we store it in memory, otherwise we write directly to a file to not potentially OOM systems where command output can be large.

@TurboTurtle
Copy link
Member

I see there's a lot we can do with the info output, and generally spruce up the collections at large. I'll throw something together and get something posted on my lunch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants