I have a strange experience with current beta (withour background_process ):
* All cron jobs seem to run smoothly
* But "Ultimate Cron Launcher Serial cleanup" logs on every run "Cleaned up 21 expired locks"

Also noted
* I don't understand the difference between the green checkbox and the blue info status
* When i kept running "drush core-cron" all jobs were run every time, until i changed that to "drush cron-run". Maybe a message is useful like "Last cron was run from core. To benefit from ultimatecron run drush cron-run instead of drush core-cron"

Maybe the "expired locks" are just a leftover from the wrong drush command. Then we have it here in the knowledgebase.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gielfeldt’s picture

But "Ultimate Cron Launcher Serial cleanup" logs on every run "Cleaned up 21 expired locks"

Yes. This message is to be expected. I should probably change the wording though. The explanation is, that the locking system is a 2-step cleanup process. When a lock is released, it is not removed from the database, but rather its state is changed. The cron job in question then removes them from the database with the mentioned message. A more proper message would be "Removed 21 old locks from the DB" or something. (The technical reasoning behind the 2-step cleanup is to mitigate potential gap-locks).
21 locks should be the result of you having exactly 21 cron jobs.

I don't understand the difference between the green checkbox and the blue info status

The icons reflect the max severity level that has been logged during the jobs run.

  • INFO, DEBUG = Green tick
  • NOTICE = Blue info
  • WARNING = Yellow warning
  • ERROR, CRITICAL, ALERT, EMERGENCY = Red cross

When i kept running "drush core-cron" all jobs were run every time, until i changed that to "drush cron-run". Maybe a message is useful like "Last cron was run from core. To benefit from ultimatecron run drush cron-run instead of drush core-cron"

When using Drush < 6, Ultimate Cron cannot hook into the core-cron drush command. In this case, the core cron jobs will be executed by Drupal core, but Ultimate Cron will still catch the log messages. However, it will catch all messages for all the jobs and log them for each job. When this happens, the init-message in the job log should state "Launched by Drupal core".

geek-merlin’s picture

Component: Code » Documentation

Thank you for all the explanation!!

gielfeldt’s picture

Status: Active » Closed (works as designed)
jwilson3’s picture

Component: Documentation » Code
Category: Support request » Task
Status: Closed (works as designed) » Needs work

This message is to be expected. I should probably change the wording though.

Maybe if this hadn't been closed, but just reworded I wouldn't be here searching from Google what this message means.

I propose a wording change like the following, which reads and feels less like an error and more like a status:

Unlocked N completed cron tasks.

This proposed change does essentially two things:

  1. State what is happening: i,e. removing/releasing the lock, instead of "cleaning up".
  2. State more accurately what underlying object is affected, in a positive way, i.e "completed cron tasks" instead of "expired locks".
maximpodorov’s picture

Are these messages worth logging if they do not make much sense in terms of "everything is OK" or "please pay attention"? I suggest to disable this logging to reduce garbage volume in logs.

arnested’s picture

Status: Needs work » Closed (outdated)

I'm closing this since Drupal 7 is now unsupported and there will be no more development on the Drupal 7 branch of Ultimate Cron either.

Thank you for taking the time and effort in reporting this issue, even though it never got resolved.

intrafusion’s picture

Version: 7.x-2.0-beta5 » 8.x-2.x-dev
Status: Closed (outdated) » Needs work

This is still a valid issue on the current version of Ultimate cron, our logs are littered with this garbage everytime cron runs (15 mins for our production site)

There should at least be an option to turn this off.

man-1982 made their first commit to this issue’s fork.

a.koch82’s picture

StatusFileSize
new113.6 KB

Added configurable settings to disable lock cleanup logging or change its log level (debug/info/notice). Settings available at /admin/config/system/cron/settings under "Lock cleanup logging".

Includes 7 new tests (3 kernel + 4 functional).

Lock settings

a.koch82’s picture

Status: Needs work » Needs review
berdir’s picture

Status: Needs review » Needs work

Most of those tests add no value, I'm going to assume they were generated. We don't need to test the config API. A single test to save the UI would be sufficient. There also don't seem to be tests for the harder and more useful part of the actual logic where the config is used.

Configurable loglevel also seems overkill and if done, should use the log() method with level argument.

I'm open to just removing this without any setting, since there's no value in this information. That would also allow to simplify the code, we don't know the know the count, I'm also not sure why this does an update plus a looping select and a delete.

a.koch82’s picture

Hi @berdir let me correct according your comments.

a.koch82’s picture

Status: Needs work » Needs review
terry_kolodiy’s picture

StatusFileSize
new24.41 KB

I can confirm that it's a good change. We really don't need this data on watchdog.
Used a patch on my project (attached it in the comment).
I'm sure it can be merged.

Thanks

terry_kolodiy’s picture

Status: Needs review » Reviewed & tested by the community
terry_kolodiy’s picture

StatusFileSize
new965 bytes

Patch with simple removal of count (from MR)

liam morland made their first commit to this issue’s fork.

berdir’s picture

Title: Utimate cron "Cleaned up N expired locks" » Remove "Cleaned up N expired locks" log messages
berdir’s picture

Status: Reviewed & tested by the community » Fixed

Merging.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • berdir committed 597525ca on 8.x-2.x authored by man-1982
    feat: #2245139 Remove "Cleaned up N expired locks" log messages
    
    By: man...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.