pulp / pulp/pulpcore

Queued repo publish tasks latch on to the repo version of when the task was enqueued, which makes it useless for sync-and-publish operations

Open
#3,452 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue
Dominant language
Python
Stars
598
Forks
168
Avg merge
1d 4h
Merged PRs (30d)
86

Description

There appears to be a race condition somewhere when syncing / publishing a repo. I have observed a situation where:

  1. While sync task was running I filed a publish task, which correctly entered a "waiting" state.
  2. The sync task succeeded, creating version 1 of the repo.
  3. The publish task started running about a tenth of a second later.
  4. The publish task succeeded about a tenth of a second after that, creating a publication for version 0.
  5. My repo didn't show up where I expected it to, since there was no content in version 0. Doing another publish correctly published version 1 and made my content available.

Given the above, I assume there must be a race condition somewhere that allows the Task state to be committed before the actual results of the sync are committed. This should not be, the sync should be hard finished before the task releases its lock on the resource.

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 reproducing the reported sequence: run a sync, queue a publish while it is running, and check which repository version the publish uses. Trace the sync and publish task completion and resource-lock release ordering; done means a queued publish waits for the sync results to be committed and publishes the new version rather than version 0.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
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.