CronRegistry.jobs map should be protected for concurrent access

Description

`CronRegistry.job map[string]Schedule` is not protected by any lock and since it can be concurrently accessed it can produce an error like this:

 

The map should be protected by an explicit lock or maybe have it as a sync.Map.

Related forum question:

Environment

None

Activity

Show:

George Kechagias January 27, 2025 at 6:52 PM
Edited

After setting up the backups to work with S3 and verified that everything is working properly with that, We introduced the following task config so that we have more jobs that could potentially trigger a sync problem.


After that, we restarted multiple times the operator so that we can trigger the `Creating or updating backup job` flow. No sync issue was observed at any of the attempts.

The related implementation that addresses the sync problems was introduced by in this PR: which looks OK from code review perspective for addressing the problem reported in this ticket.

Not a Bug

Assignee

George Kechagias

Reporter

Needs Review

Yes

Needs QA

No

Fix versions

Priority

Created December 23, 2024 at 6:38 PM
Updated February 14, 2025 at 6:49 PM
Resolved February 14, 2025 at 6:49 PM
Loading...