nextcloud / nextcloud/server

[Bug]: Dirty DB reads on `\OC\BackgroundJob\JobList::add`

Open
#43,892 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 28-feedback 29-feedback bug feature: database
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

There are dirty db reads that may have an impact on clustered db setups when adding multilple jobs (\OC\BackgroundJob\JobList::add) of the same type.

Steps to reproduce
  1. Register multiple jobs like \OCA\Mail\Service\AccountService::save

Can cause dirty reads and addition of multiple same jobs

Expected behavior

No dirty readys of the db.

Installation method

None

Nextcloud Server version

master

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

Found in https://github.com/nextcloud/groupware/issues/24

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing \OC\BackgroundJob\JobList::add, using the multiple registrations described for \OCA\Mail\Service\AccountService::save as the reproduction case. Investigate the database reads involved and verify that adding jobs of the same type does not produce dirty reads or duplicate jobs, especially on clustered database setups.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.