Repository navigation
Don't pick .lock'd and new dirs for deletion when problem dirs grow over size limit - #629
Conversation
mgrabovsky
left a comment
There was a problem hiding this comment.
Nitpick: First commit message has a typo ("dirzise").
03acec6 to
cdedf96
Compare
| { | ||
| log_warning("Skipping %s: directory locked. Is a backtrace being generated?", dname); | ||
| double sz = libreport_get_dirsize(dname); | ||
| size += sz; |
There was a problem hiding this comment.
Why is this needed if we’re skipping the directory? I’m looking at the sosreport-still-being-generated case above and it doesn’t do that.
There was a problem hiding this comment.
I thought the directory's size still counts to the total size of the directory where problem directories are stored (/var/spool/abrt), even if we're skipping it for now.
There was a problem hiding this comment.
Yeah, that makes sense. Do you think we should do the same above, then?
There was a problem hiding this comment.
Ideally, we would fold the two cases into yours, but that might be more involved, given that sosreport generation comes from an event handler.
There was a problem hiding this comment.
Yeah, that makes sense. Do you think we should do the same above, then?
Yeah, makes sense to me.
When trimming problem directories to MaxCrashReportsSize as a result of a new problem being detected whose directory exceeds the limit, skip direcories that have been .lock'd by abrt-action-generate-backtrace or abrt-action-generate-core-backtrace Signed-off-by: Michal Fabik <[email protected]>
When trimming the problem directories, dirs get skipped if a sosreport is being generated in them. However, the dir size still needs to be counted towards the total size limit, even if the dir can't be picked for deletion right now. Signed-off-by: Michal Fabik <[email protected]>
Add an argument to libreport_get_dirsize_find_largest_dir containing the problem directory that triggered the trimming of problem dirs. Make sure the newly reported problem dir doesn't get picked for deletion in case it happens to make /var/spool/abrt size grow over MaxCrashReportsSize. Signed-off-by: Michal Fabik <[email protected]>
cdedf96 to
20fff7a
Compare
Signed-off-by: Michal Fabik <[email protected]>
1bdaecd to
5a3821d
Compare
| maxsz = sz; | ||
| free(*worst_dir); | ||
| *worst_dir = libreport_xstrdup(ep->d_name); | ||
| if (!proc_dir || strcmp(proc_dir, ep->d_name) != 0) |
There was a problem hiding this comment.
You could fold this into an else if and save some horizontal whitespace.
|
Looks good to me overall. |
mgrabovsky
left a comment
There was a problem hiding this comment.
Looks good to me as well.
See commits.
Resolves abrt/abrt#1450.
See also abrt/abrt#1481