AD0-E725 practice question 5 of 10

A Developer creates daily cron jobs to automate a client’s business processes, including automated stock imports via CSV files once per day. After a…

Full set: 50 questions
A Developer creates daily cron jobs to automate a client’s business processes, including automated stock imports via CSV files once per day. After a few days, it is noted that the cron jobs do not run daily. The Developer discovers the cron jobs are sometimes assigned a ‘missed’ status and do not execute, and other cron jobs become stuck during the execution time of the custom cron jobs. Which option should the Developer use to ensure the cron jobs consistently run each day?
Answer options
A: Implement a custom group for the cron jobs in the crontab.xml. Correct answer
B: Set the cron jobs to run multiple times per day instead of once daily.
C: In the execute() function, implement a lock checker to make sure the cron runs alone.
Correct Answer:
A. Implement a custom group for the cron jobs in the crontab.xml.
Explanation

The issue described, where a custom cron job is marked as 'missed' and other jobs get stuck, is a classic symptom of cron job contention. By default, custom cron jobs are placed in the default group. If a long-running task like a large stock import runs in this group, it can prevent other jobs in the same group from executing on schedule. Creating a dedicated, custom cron group for the stock import isolates its execution process. This ensures it does not interfere with or get blocked by other system cron jobs, allowing it to run reliably and preventing the 'missed' status.

Why Incorrect

B. Set the cron jobs to run multiple times per day instead of once daily. This does not solve the underlying resource contention issue. The job could still be missed or block others, and running it more frequently might even exacerbate the problem.
C. In the execute() function, implement a lock checker to make sure the cron runs alone. A lock checker prevents the same job from running concurrently, which is a good practice but does not solve the problem of it blocking or being blocked by other different jobs in the same cron group.

References

1. Adobe Commerce Developer Documentation

"Configure custom cron jobs and cron groups": "We recommend you run your custom cron job in a separate group. This way

your custom cron job does not interfere with other cron jobs. For example

if you have a long-running cron job in the default group

it can cause other cron jobs to be missed." This directly supports creating a custom group to resolve the issue.

Source: Adobe Commerce Developer Documentation > Fundamentals > Configure > Configure cron jobs > Configure custom cron jobs and cron groups.

2. Adobe Commerce Developer Documentation

"Cron job configuration reference": This document details the crontab.xml configuration

showing how to define a with a unique id. It explains that cron jobs are processed on a group-by-group basis

confirming that separating a job into its own group isolates its execution from others.

Source: Adobe Commerce Developer Documentation > Fundamentals > Configure > Module configuration files > crontab.xml.

Scroll to Top