Skip to content

[BUG] In high-traffic website, event log cleaning mechanism never breaks out of "while" loop #4927

@m-michalis

Description

@m-michalis

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

In between while loop runs, if the websites has high-traffic, $eventIds will not reach 0 in a timely manner, which, in my case, i've seen the cron job run for over 40 minutes.

Current code:
Mage_Reports_Model_Resource_Event::clean

Expected Behavior

Clean ops should be in-dependent on traffic while running

Steps To Reproduce

  1. use k6 to force such traffic
  2. meanwhile run the cleaning process

Environment

- OpenMage: 20.10.2
- php: 8.2

Anything else?

Suggestions:

  • Either run so fast that a loop-run will reach zero results (👎 )
  • Filter the joined visitor_table table with Mage::getSingleton('getLogCleanTime')->getLogCleanTime() like app/code/core/Mage/Log/Model/Resource/Log.php#L70
  • This is how i mitigated for the time being:
    // -- code
    while(true) {
          // -- code
          if(count($eventIds) < 1000){
              break;
          }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions