Bug 2027358

Summary: Large CRL file operation causes OOM error in Candlepin
Product: Red Hat Satellite Reporter: James Jeffers <jjeffers>
Component: CandlepinAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Danny Synk <dsynk>
Severity: high Docs Contact:
Priority: high    
Version: 6.8.0CC: dsynk, ehelms, msunil, nmoumoul, osousa, pmendezh, pmoravec, redakkan, saydas
Target Milestone: 6.10.2Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: candlepin-3.1.31-1,candlepin-4.0.8-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1927532 Environment:
Last Closed: 2022-01-19 14:40:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 4 Danny Synk 2022-01-04 20:14:38 UTC
Verified on Satellite 6.10.2, snap 1.

Steps to Test:

1. Add the following line to /etc/candlepin/candlepin.conf to set the CRLUpdateJob to run every 3 minutes:

candlepin.async.jobs.CRLUpdateJob.schedule=0 0/3 * * * ?

2. Restart the tomcat service:

# systemctl restart tomcat

3. Register a host to Satellite.

4. Check the time when /var/lib/candlepin/candlepin-crl.crl was last updated:

5. Follow the Candlepin log and wait for the CRLUpdateJob to run.

6. Between two runs of the job, attach a subscription to the host registered in step 3, then immediately remove that subscription.

7. After the job runs again, check the last modified time of the CRL file again:

Expected Results:

On a Satellite 6.10.2 that was upgraded from Satellite 6.9, the CRL file is not updated. On a Satellite 6.10.2 that was freshly installed, the file is never created.

Actual Results:

On a Satellite 6.10.2 that was upgraded from Satellite 6.9, the CRL file is not updated. On a Satellite 6.10.2 that was freshly installed, the file is never created.

In both cases, the job run results in an error in /var/log/candlepin/candlepin.log:

```
2022-01-04 15:00:00,199 [thread=QuartzScheduler_Worker-4] [=, org=, csid=] INFO  org.candlepin.async.JobManager - Job queued: AsyncJobStatus [id: 8a8182757e26a962017e26ad52b40016, name: CRLUpdateJob, key: CRLUpdateJob, state: QUEUED]
2022-01-04 15:00:00,284 [thread=Thread-5 (ActiveMQ-client-global-threads)] [job=8a8182757e26a962017e26ad52b40016, job_key=CRLUpdateJob, org=, csid=] ERROR org.candlepin.async.JobManager - No registered job class for job: CRLUpdateJob
2022-01-04 15:00:00,284 [thread=Thread-5 (ActiveMQ-client-global-threads)] [=, org=, csid=] ERROR org.candlepin.async.JobMessageReceiver - Job processing failed terminally; committing job message as acknowledged: Message [id: 2147484742, address: job, body: {"jobId":"8a8182757e26a962017e26ad52b40016","jobKey":"CRLUpdateJob"}]
```

This error reflects the fact that the CRLUpdateJob was removed from Candlepin and replaced with the CertificateCleanupJob in https://github.com/candlepin/candlepin/pull/3078.

Comment 10 errata-xmlrpc 2022-01-19 14:40:57 UTC
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 (Moderate: Satellite 6.10.2 Async Bug Fix Update), 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/RHSA-2022:0190