Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • erp5 erp5
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Merge requests 144
    • Merge requests 144
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !2164

Open
Created Sep 25, 2025 by Kazuhiko Shiozaki@kazuhikoOwner
  • Report abuse
Report abuse

Stabilise benchmarks performance

  • Overview 5
  • Commits 1
  • Changes 1

Sometimes, not always, KeyError happens many times in DeliveryBuilder_selectConfirmedDeliveryList script during benchmark tests.

That can happen when three Zope transactions run like the following order in parallel :

* Node1: create a Sale Packing List
  * Node2: build activity started
* Node1: transaction committed
    * Node3: index activity started
    * Node3: MariaDB transaction committed
  * Node2: portal_catalog() finds a row

Here, Node2 cannot find the Sale Packing List, because Node2 transaction started before the commit of Node1, thus brain.getObject() raises an KeyError.

It can happen elsewhere and it is normally not a big issue, as the activity will be retried. You can check if you have such case by grepping activity nodes log files like $ xzgrep -aB3 "zsqlbrain.py, .*in getObject$" srv/backup/logrotate/zope-*-event.log-*.xz.

But for benchmarks (see software/erp5/test/test/benchmarks.py in SlapOS repository), the performance differs much if such KeyError happens a lot or not. This merge request is to ignore possible KeyError in benchmarks so that we can get stable results.

Here is the comparison with / without this merge request's changes when KeyError happen around 1000 times.

  • total duration with KeyError: 9734.35 seconds
  • total duration without KeyError: 7774.58 seconds

11.8-KeyError

Edited Sep 25, 2025 by Kazuhiko Shiozaki
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: stabilise-benchmarks
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7