pulpcore 3.90.0__py3-none-any.whl → 3.90.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pulpcore might be problematic. Click here for more details.

@@ -6,6 +6,6 @@ class PulpCertGuardPluginAppConfig(PulpPluginAppConfig):
6
6
 
7
7
  name = "pulp_certguard.app"
8
8
  label = "certguard"
9
- version = "3.90.0"
9
+ version = "3.90.1"
10
10
  python_package_name = "pulpcore"
11
11
  domain_compatible = True
pulp_file/app/__init__.py CHANGED
@@ -8,6 +8,6 @@ class PulpFilePluginAppConfig(PulpPluginAppConfig):
8
8
 
9
9
  name = "pulp_file.app"
10
10
  label = "file"
11
- version = "3.90.0"
11
+ version = "3.90.1"
12
12
  python_package_name = "pulpcore"
13
13
  domain_compatible = True
pulpcore/app/apps.py CHANGED
@@ -239,7 +239,7 @@ class PulpAppConfig(PulpPluginAppConfig):
239
239
  label = "core"
240
240
 
241
241
  # The version of this app
242
- version = "3.90.0"
242
+ version = "3.90.1"
243
243
 
244
244
  # The python package name providing this app
245
245
  python_package_name = "pulpcore"
@@ -21,23 +21,26 @@ def instrumentation(exporter=None, reader=None, provider=None):
21
21
  try:
22
22
  response = await handler(request)
23
23
  status_code = response.status
24
+
25
+ return response
24
26
  except web.HTTPException as exc:
25
27
  status_code = exc.status
26
- response = exc
27
-
28
- duration_ms = (time.time() - start_time) * 1000
29
-
30
- request_duration_histogram.record(
31
- duration_ms,
32
- attributes={
33
- "http.method": request.method,
34
- "http.status_code": normalize_http_status(status_code),
35
- "http.route": _get_view_request_handler_func(request),
36
- "worker.name": get_worker_name(),
37
- },
38
- )
39
-
40
- return response
28
+ raise exc
29
+ except Exception as exc:
30
+ status_code = exc.status if hasattr(exc, "status") else 500
31
+ raise exc
32
+ finally:
33
+ duration_ms = (time.time() - start_time) * 1000
34
+
35
+ request_duration_histogram.record(
36
+ duration_ms,
37
+ attributes={
38
+ "http.method": request.method,
39
+ "http.status_code": normalize_http_status(status_code),
40
+ "http.route": _get_view_request_handler_func(request),
41
+ "worker.name": get_worker_name(),
42
+ },
43
+ )
41
44
 
42
45
  return middleware
43
46
 
pulpcore/tasking/tasks.py CHANGED
@@ -297,7 +297,7 @@ async def adispatch(
297
297
  task.set_canceling()
298
298
  task.set_canceled(TASK_STATES.CANCELED, "Resources temporarily unavailable.")
299
299
  if send_wakeup_signal:
300
- wakeup_worker(TASK_WAKEUP_UNBLOCK)
300
+ await sync_to_async(wakeup_worker)(TASK_WAKEUP_UNBLOCK)
301
301
  return task
302
302
 
303
303
 
@@ -194,6 +194,9 @@ class PulpcoreWorker:
194
194
  "Cleanup record of missing %s process %s.", app_worker.app_type, app_worker.name
195
195
  )
196
196
  qs.delete()
197
+ # This will also serve as a pacemaker because it will be triggered regularly.
198
+ # Don't bother the others.
199
+ self.wakeup_unblock = True
197
200
 
198
201
  def beat(self):
199
202
  if self.app_status.last_heartbeat < timezone.now() - self.heartbeat_period:
@@ -214,7 +217,7 @@ class PulpcoreWorker:
214
217
  # to be able to report on a congested tasking system to produce reliable results.
215
218
  self.record_unblocked_waiting_tasks_metric()
216
219
 
217
- def notify_workers(self, reason="unknown"):
220
+ def notify_workers(self, reason):
218
221
  self.cursor.execute("SELECT pg_notify('pulp_worker_wakeup', %s)", (reason,))
219
222
 
220
223
  def cancel_abandoned_task(self, task, final_state, reason=None):
@@ -274,25 +277,28 @@ class PulpcoreWorker:
274
277
  Also it clears the notification about tasks to be unblocked and sends the notification that
275
278
  new unblocked tasks are made available.
276
279
 
277
- Returns the number of new unblocked tasks.
280
+ Returns None if another worker held the lock, True if unblocked tasks exist, else False.
278
281
  """
279
282
 
280
283
  assert not self.auxiliary
281
284
 
282
- count = 0
283
- self.wakeup_unblock_tasks = False
285
+ self.wakeup_unblock = False
284
286
  with contextlib.suppress(AdvisoryLockError), PGAdvisoryLock(TASK_UNBLOCKING_LOCK):
285
- if count := self._unblock_tasks():
287
+ self._unblock_tasks()
288
+
289
+ if (
290
+ Task.objects.filter(state__in=TASK_INCOMPLETE_STATES, app_lock=None)
291
+ .exclude(unblocked_at=None)
292
+ .exists()
293
+ ):
286
294
  self.notify_workers(TASK_WAKEUP_HANDLE)
287
- return count
295
+ return True
296
+ return False
297
+ return None
288
298
 
289
299
  def _unblock_tasks(self):
290
- """Iterate over waiting tasks and mark them unblocked accordingly.
300
+ """Iterate over waiting tasks and mark them unblocked accordingly."""
291
301
 
292
- Returns the number of new unblocked tasks.
293
- """
294
-
295
- count = 0
296
302
  taken_exclusive_resources = set()
297
303
  taken_shared_resources = set()
298
304
  # When batching this query, be sure to use "pulp_created" as a cursor
@@ -320,7 +326,6 @@ class PulpcoreWorker:
320
326
  task.pulp_domain.name,
321
327
  )
322
328
  task.unblock()
323
- count += 1
324
329
 
325
330
  elif (
326
331
  task.state == TASK_STATES.WAITING
@@ -339,7 +344,6 @@ class PulpcoreWorker:
339
344
  task.pulp_domain.name,
340
345
  )
341
346
  task.unblock()
342
- count += 1
343
347
  elif task.state == TASK_STATES.RUNNING and task.unblocked_at is None:
344
348
  # This should not happen in normal operation.
345
349
  # And it is only an issue if the worker running that task died, because it will
@@ -356,21 +360,22 @@ class PulpcoreWorker:
356
360
  taken_exclusive_resources.update(exclusive_resources)
357
361
  taken_shared_resources.update(shared_resources)
358
362
 
359
- return count
360
-
361
363
  def sleep(self):
362
364
  """Wait for signals on the wakeup channel while heart beating."""
363
365
 
364
366
  _logger.debug(_("Worker %s entering sleep state."), self.name)
365
367
  while not self.shutdown_requested and not self.wakeup_handle:
366
368
  r, w, x = select.select(
367
- [self.sentinel, connection.connection], [], [], self.heartbeat_period.seconds
369
+ [self.sentinel, connection.connection],
370
+ [],
371
+ [],
372
+ 0 if self.wakeup_unblock else self.heartbeat_period.seconds,
368
373
  )
369
374
  self.beat()
370
375
  if connection.connection in r:
371
376
  connection.connection.execute("SELECT 1")
372
- if self.wakeup_unblock:
373
- self.unblock_tasks()
377
+ if self.wakeup_unblock:
378
+ self.unblock_tasks()
374
379
  if self.sentinel in r:
375
380
  os.read(self.sentinel, 256)
376
381
  _logger.debug(_("Worker %s leaving sleep state."), self.name)
@@ -407,21 +412,21 @@ class PulpcoreWorker:
407
412
  [self.sentinel, connection.connection, task_process.sentinel],
408
413
  [],
409
414
  [],
410
- self.heartbeat_period.seconds,
415
+ 0 if self.wakeup_unblock or self.cancel_task else self.heartbeat_period.seconds,
411
416
  )
412
417
  self.beat()
413
418
  if connection.connection in r:
414
419
  connection.connection.execute("SELECT 1")
415
- if self.cancel_task:
416
- _logger.info(
417
- _("Received signal to cancel current task %s in domain: %s."),
418
- task.pk,
419
- domain.name,
420
- )
421
- cancel_state = TASK_STATES.CANCELED
422
- self.cancel_task = False
423
- if self.wakeup_unblock:
424
- self.unblock_tasks()
420
+ if self.cancel_task:
421
+ _logger.info(
422
+ _("Received signal to cancel current task %s in domain: %s."),
423
+ task.pk,
424
+ domain.name,
425
+ )
426
+ cancel_state = TASK_STATES.CANCELED
427
+ self.cancel_task = False
428
+ if self.wakeup_unblock:
429
+ self.unblock_tasks()
425
430
  if task_process.sentinel in r:
426
431
  if not task_process.is_alive():
427
432
  break
@@ -589,7 +594,7 @@ class PulpcoreWorker:
589
594
  if not self.auxiliary:
590
595
  # Attempt to flush the task queue completely.
591
596
  # Stop iteration if no new tasks were found to unblock.
592
- while self.unblock_tasks():
597
+ while self.unblock_tasks() is not False:
593
598
  self.handle_unblocked_tasks()
594
599
  self.handle_unblocked_tasks()
595
600
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pulpcore
3
- Version: 3.90.0
3
+ Version: 3.90.1
4
4
  Summary: Pulp Django Application and Related Modules
5
5
  Author-email: Pulp Team <pulp-list@redhat.com>
6
6
  Project-URL: Homepage, https://pulpproject.org
@@ -1,6 +1,6 @@
1
1
  pulp_certguard/__init__.py,sha256=llnEd00PrsAretsgAOHiNKFbmvIdXe3iDVPmSaKz7gU,71
2
2
  pulp_certguard/pytest_plugin.py,sha256=qhRbChzqN2PROtD-65KuoTfKr5k9T3GPsz9daFgpqpM,852
3
- pulp_certguard/app/__init__.py,sha256=uY5MxqWB50uPfzKnPkMo6xp5m1OW9QAxP2SpB1NaQ7s,297
3
+ pulp_certguard/app/__init__.py,sha256=F7stkrNuVpBqTZUY4RcOi7-smY495tu_rH1PPb6CsqQ,297
4
4
  pulp_certguard/app/models.py,sha256=YLEhBtZM4hetekVZ_GTnbLlWD6CkIQw2B3ILwXRcq-s,7483
5
5
  pulp_certguard/app/serializers.py,sha256=9IxlQiy783RdKF9oI1mrYS4haG5Boy2DOjfP_eJtMLY,1726
6
6
  pulp_certguard/app/viewsets.py,sha256=1_gNmsWyOT8kcOiGVkn4-wrtAjZO4wC8q0-aoEsCpjI,697
@@ -51,7 +51,7 @@ pulp_certguard/tests/unit/test_rhsm_check_path.py,sha256=Q1CsXnUgD7ELvtolPeumyNr
51
51
  pulp_file/__init__.py,sha256=0vOCXofR6Eyxkg4y66esnOGPeESCe23C1cNBHj56w44,61
52
52
  pulp_file/manifest.py,sha256=1WwIOJrPSkFcmkRm7CkWifVOCoZvo_nnANgce6uuG7U,3796
53
53
  pulp_file/pytest_plugin.py,sha256=l1PvTxUi5D3uJy4SnHWNhr-otWEYNcm-kc5nSqVJg0Y,10646
54
- pulp_file/app/__init__.py,sha256=bRADl_3HIkWGzx9Dv4ZJ6k71Kiq0-LenUmRK-MOaGrA,292
54
+ pulp_file/app/__init__.py,sha256=I-CfxiKEhkdF6ZZEIBXMHHutQjocHCPVX5zO1rlqLbA,292
55
55
  pulp_file/app/modelresource.py,sha256=v-m-_bBEsfr8wG0TI5ffx1TuKUy2-PsirhuQz4XXF-0,1063
56
56
  pulp_file/app/models.py,sha256=QsrVg_2uKqnR89sLN2Y7Zy260_nLIcUfa94uZowlmFw,4571
57
57
  pulp_file/app/replica.py,sha256=OtNWVmdFUgNTYhPttftVNQnSrnvx2_hnrJgtW_G0Vrg,1894
@@ -97,7 +97,7 @@ pulpcore/pytest_plugin.py,sha256=fy9vz5-bw30T7f4jxDtNIgF7L_0MJ_q7KIAzpvizvnY,382
97
97
  pulpcore/responses.py,sha256=mIGKmdCfTSoZxbFu4yIH1xbdLx1u5gqt3D99LTamcJg,6125
98
98
  pulpcore/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
99
  pulpcore/app/access_policy.py,sha256=5vCKy6WoHtIt1_-eS5vMaZ7CmR4G-CIpsrB8yT-d88Q,6079
100
- pulpcore/app/apps.py,sha256=RzXIJpB4k0a0pscXvqlZqf2h2lD8AyQXw9zlQSuj_ZU,17412
100
+ pulpcore/app/apps.py,sha256=QpFkqHrl7TSQVC0Dc8HzHVT9Re5yJLyM5UbScyVrIIo,17412
101
101
  pulpcore/app/authentication.py,sha256=1LIJW6HIQQlZrliHy__jdzkDEh6Oj7xKgd0V-vRcDus,2855
102
102
  pulpcore/app/checks.py,sha256=jbfTF7nmftBbky4AQXHigpyCaGydKasvRUXsd72JZVg,1946
103
103
  pulpcore/app/entrypoint.py,sha256=GYEq4GjglQZhFlU3865AT_H0nPypDKJAsf8qdyR4tPY,4985
@@ -292,7 +292,7 @@ pulpcore/content/__init__.py,sha256=mHYi85Hy-IhG50AR-jICk9pIiMUatHJx5wO1dFJkn9k,
292
292
  pulpcore/content/authentication.py,sha256=lEZBkXBBBkIdtFMCSpHDD7583M0bO-zsZNYXTmpr4k8,3235
293
293
  pulpcore/content/entrypoint.py,sha256=DiQTQzfcUiuyl37uvy6Wpa_7kr8t79ekpMHr31MDL2s,2132
294
294
  pulpcore/content/handler.py,sha256=EubizF5HP5QK_N5eMe8sHIyUZT3ipVhaQJ-NYb1dr5g,56959
295
- pulpcore/content/instrumentation.py,sha256=H0N0GWzvOPGGjFi6eIbGW3mcvagfnAfazccTh-BZVmE,1426
295
+ pulpcore/content/instrumentation.py,sha256=spnqCJljCxshc4I05YkFxk4dFWjrqs8G0tBztP-jrQo,1608
296
296
  pulpcore/download/__init__.py,sha256=s3Wh2GKdsmbUooVIR6wSvhYVIhpaTbtfR3Ar1OJhC7s,154
297
297
  pulpcore/download/base.py,sha256=4KCAYnV8jSOX078ETwlfwNZGY3xCBF9yy866tyGKAzE,13095
298
298
  pulpcore/download/factory.py,sha256=NQ1c7lqf8cCTZvhBeDaDjCE2qBAvPRzSDbtP2yN8SFk,9679
@@ -344,8 +344,8 @@ pulpcore/tasking/_util.py,sha256=fPW4k1nUa_NZ0ywy_A15Fuiejo5stY58abPbZTXw5t8,990
344
344
  pulpcore/tasking/entrypoint.py,sha256=eAypZD4ORoNOrmBeMdbwO9p6GSQ59bMvZ3TrbnE0czw,1305
345
345
  pulpcore/tasking/kafka.py,sha256=76z4DzeXM1WL5uu1HlKnduWeLO3-b-czvGBXdWR6054,3845
346
346
  pulpcore/tasking/storage.py,sha256=zQkwlpC_FDQtmZGZ8vKwHqxvD6CLO_gAS4Q7wijZE-k,3106
347
- pulpcore/tasking/tasks.py,sha256=cn0y70GwXEOT_Y_mHnWce8Yvu0JSsu1TVBvMmhYjeZ4,16394
348
- pulpcore/tasking/worker.py,sha256=TJ2nQhA2TpAfs-w5WyOy2owCm4ZDfCrkvmCYQGDnPVY,25955
347
+ pulpcore/tasking/tasks.py,sha256=eda4mg6O7kWKfqR9UakLUdUCxPxveBlUixD6ZG6h5cU,16415
348
+ pulpcore/tasking/worker.py,sha256=qLT0mbL6GimUOgH5xbD2aIf4Dxd23lhNuKlzwNBc0sA,26285
349
349
  pulpcore/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
350
350
  pulpcore/tests/functional/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
351
351
  pulpcore/tests/functional/content_with_coverage.py,sha256=gQK8himy32s9O9vpXdgoM6-_z2KySaXm5rTga9z0jGI,260
@@ -446,9 +446,9 @@ pulpcore/tests/unit/stages/test_artifactdownloader.py,sha256=DX6jHctGYbDhsnzQpXf
446
446
  pulpcore/tests/unit/stages/test_stages.py,sha256=H1a2BQLjdZlZvcb_qULp62huZ1xy6ItTcthktVyGU0w,4735
447
447
  pulpcore/tests/unit/viewsets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
448
448
  pulpcore/tests/unit/viewsets/test_viewset_base.py,sha256=gmVIgE9o0tAdiF92HCNiJkb1joc8oEaG5rnzh5V1loc,4837
449
- pulpcore-3.90.0.dist-info/licenses/LICENSE,sha256=dhnHU8rJXUdAIgIjveSKAyYG_KzN5eVG-bxETIGrNW0,17988
450
- pulpcore-3.90.0.dist-info/METADATA,sha256=vCTX7XfMuvbfNuLw3MbGSdHyUc4cu9rbMOWuRIIUygw,4104
451
- pulpcore-3.90.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
452
- pulpcore-3.90.0.dist-info/entry_points.txt,sha256=OZven4wzXzQA5b5q9MpP4HUpIPPQCSvIOvkKtNInrK0,452
453
- pulpcore-3.90.0.dist-info/top_level.txt,sha256=6h-Lm3FKQSaT_nL1KSxu_hBnzKE15bcvf_BoU-ea4CI,34
454
- pulpcore-3.90.0.dist-info/RECORD,,
449
+ pulpcore-3.90.1.dist-info/licenses/LICENSE,sha256=dhnHU8rJXUdAIgIjveSKAyYG_KzN5eVG-bxETIGrNW0,17988
450
+ pulpcore-3.90.1.dist-info/METADATA,sha256=I8c2u1ahZ9k-DKCcnHQCYPHzdCiFDke8rqV3bF8n2RI,4104
451
+ pulpcore-3.90.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
452
+ pulpcore-3.90.1.dist-info/entry_points.txt,sha256=OZven4wzXzQA5b5q9MpP4HUpIPPQCSvIOvkKtNInrK0,452
453
+ pulpcore-3.90.1.dist-info/top_level.txt,sha256=6h-Lm3FKQSaT_nL1KSxu_hBnzKE15bcvf_BoU-ea4CI,34
454
+ pulpcore-3.90.1.dist-info/RECORD,,