Bug 1388656
| Summary: | ModSecurity: collections_remove_stale: Failed deleting collection | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Robert Bost <rbost> | ||||||||||
| Component: | mod_security | Assignee: | Daniel Kopeček <dkopecek> | ||||||||||
| Status: | CLOSED ERRATA | QA Contact: | Jakub Heger <jheger> | ||||||||||
| Severity: | high | Docs Contact: | |||||||||||
| Priority: | high | ||||||||||||
| Version: | 7.4 | CC: | akhaitov, aogburn, cww, dkopecek, dmasirka, insights-rule-dev, isenfeld, jheger, mbabacek, mgrepl, mkolaja, pvrabec, rbost | ||||||||||
| Target Milestone: | rc | Keywords: | Patch, Triaged | ||||||||||
| Target Release: | --- | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| Whiteboard: | |||||||||||||
| Fixed In Version: | mod_security-2.9.2-1.el7 | Doc Type: | If docs needed, set a value | ||||||||||
| Doc Text: | Story Points: | --- | |||||||||||
| Clone Of: | |||||||||||||
| : | 1650268 (view as bug list) | Environment: | |||||||||||
| Last Closed: | 2018-04-10 16:34:21 UTC | Type: | Bug | ||||||||||
| Regression: | --- | Mount Type: | --- | ||||||||||
| Documentation: | --- | CRM: | |||||||||||
| Verified Versions: | Category: | --- | |||||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||||
| Embargoed: | |||||||||||||
| Bug Depends On: | |||||||||||||
| Bug Blocks: | 1420851 | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Robert Bost
2016-10-25 20:59:45 UTC
I think this issue is related to https://issues.jboss.org/browse/JWS-489. Basically, looks like two threads are trying to delete a stale entry from database but one is winning and the other one throws the "Failed deleting collection" error. This issue has changed slightly since initially reported. The reason for noticing the issue was that the database was growing very very large. The customer had to stop httpd, remove the mod_security collection files in SecDataDir, and then start httpd back up. There is already a solution for this in mod_security 2.9.1: https://github.com/SpiderLabs/ModSecurity/pull/836 The root cause was a bad call to srand before calling rand to determine if garbage collection should run (i.e. the logic that removes expired elements from collection). Can RHEL 7 mod_security be rebased to 2.9.1 or can that one line change in the pull request above be backported? Created attachment 1228341 [details]
upstream patch
Created attachment 1228355 [details]
proposed patch
(In reply to Robert Bost from comment #4) > This issue has changed slightly since initially reported. The reason for > noticing the issue was that the database was growing very very large. The > customer had to stop httpd, remove the mod_security collection files in > SecDataDir, and then start httpd back up. > > There is already a solution for this in mod_security 2.9.1: > > https://github.com/SpiderLabs/ModSecurity/pull/836 > > The root cause was a bad call to srand before calling rand to determine if > garbage collection should run (i.e. the logic that removes expired elements > from collection). > > Can RHEL 7 mod_security be rebased to 2.9.1 or can that one line change in > the pull request above be backported? Looks like an easy fix since we already have a patch for this. Getting the acks for 7.4 might be harder. Created attachment 1250867 [details] proposed patch based on https://github.com/SpiderLabs/ModSecurity/pull/1224 Created attachment 1250868 [details]
SRPM for testing purposes
Upstream did not accept the solution in PR#1224 yet. That is because of fears of a performance hit that a solution based on a global mutex locking might cause.
Would it be possible to test the provided SRPM w.r.t. to performance in a real world environment?
*** Bug 1400625 has been marked as a duplicate of this bug. *** The upstream PR was merged as a compile-time option: https://github.com/SpiderLabs/ModSecurity/pull/1224#issuecomment-302938891 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0908 |