Skip to content

Commit 8c530ca

Browse files
pulpbotmdellweg
authored andcommitted
Update Changelog
1 parent 1a0aaf5 commit 8c530ca

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

CHANGES.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,28 @@
88

99
[//]: # (towncrier release notes start)
1010

11+
## 3.92.1 (2025-10-29) {: #3.92.1 }
12+
13+
### REST API {: #3.92.1-rest-api }
14+
15+
#### Bugfixes {: #3.92.1-rest-api-bugfix }
16+
17+
- Fixed an issue with dispatching repository.add_and_remove tasks for pull-through caching
18+
19+
### Plugin API {: #3.92.1-plugin-api }
20+
21+
No significant changes.
22+
23+
### Pulp File {: #3.92.1-pulp-file }
24+
25+
No significant changes.
26+
27+
### Pulp Cert Guard {: #3.92.1-pulp-cert-guard }
28+
29+
No significant changes.
30+
31+
---
32+
1133
## 3.92.0 (2025-10-28) {: #3.92.0 }
1234

1335
### REST API {: #3.92.0-rest-api }

pulpcore/app/util.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from functools import lru_cache
99
from gettext import gettext as _
1010
from urllib.parse import urlparse
11-
from contextlib import ExitStack
11+
from contextlib import ExitStack, contextmanager
1212
from contextvars import ContextVar
1313
from datetime import timedelta
1414
from uuid import UUID
@@ -619,6 +619,15 @@ def set_domain(new_domain):
619619
return new_domain
620620

621621

622+
@contextmanager
623+
def with_domain(domain):
624+
try:
625+
token = current_domain.set(domain)
626+
yield
627+
finally:
628+
current_domain.reset(token)
629+
630+
622631
def cache_key(base_path):
623632
"""Returns the base-key(s) used in the Cache for the passed base_path(s)."""
624633
if settings.DOMAIN_ENABLED:

pulpcore/tasking/worker.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from pulpcore.metrics import init_otel_meter
3131
from pulpcore.app.apps import pulp_plugin_configs
3232
from pulpcore.app.models import Task, AppStatus
33+
from pulpcore.app.util import with_domain
3334

3435
from pulpcore.tasking.storage import WorkerDirectory
3536
from pulpcore.tasking._util import (
@@ -38,6 +39,7 @@
3839
perform_task,
3940
startup_hook,
4041
)
42+
from pulpcore.tasking.tasks import using_workdir, execute_task
4143

4244
_logger = logging.getLogger(__name__)
4345
random.seed()
@@ -443,6 +445,18 @@ def sleep(self):
443445
os.read(self.sentinel, 256)
444446
_logger.debug(_("Worker %s leaving sleep state."), self.name)
445447

448+
def supervise_immediate_task(self, task):
449+
"""Call and supervise the immediate async task process.
450+
451+
This function must only be called while holding the lock for that task."""
452+
self.task = task
453+
with with_domain(task.domain), using_workdir():
454+
# TODO set user, cid, ...
455+
execute_task(task)
456+
if task.reserved_resources_record:
457+
self.notify_workers(TASK_WAKEUP_UNBLOCK)
458+
self.task = None
459+
446460
def supervise_task(self, task):
447461
"""Call and supervise the task process while heart beating.
448462
@@ -596,7 +610,10 @@ def handle_unblocked_tasks(self):
596610
# A running task without a lock must be abandoned.
597611
self.cancel_abandoned_task(task, TASK_STATES.FAILED, "Worker has gone missing.")
598612
elif task.state == TASK_STATES.WAITING and self.is_compatible(task):
599-
self.supervise_task(task)
613+
if task.immediate:
614+
self.supervise_immediate_task(task)
615+
else:
616+
self.supervise_task(task)
600617
else:
601618
# Probably incompatible, but for whatever reason we didn't pick it up this time,
602619
# we don't need to look at it ever again.

0 commit comments

Comments
 (0)