dbos 0.27.0a11__py3-none-any.whl → 0.27.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 dbos might be problematic. Click here for more details.
- dbos/_admin_server.py +3 -3
- dbos/_core.py +1 -1
- dbos/_dbos.py +11 -6
- dbos/_recovery.py +1 -1
- {dbos-0.27.0a11.dist-info → dbos-0.27.1.dist-info}/METADATA +1 -1
- {dbos-0.27.0a11.dist-info → dbos-0.27.1.dist-info}/RECORD +9 -9
- {dbos-0.27.0a11.dist-info → dbos-0.27.1.dist-info}/WHEEL +0 -0
- {dbos-0.27.0a11.dist-info → dbos-0.27.1.dist-info}/entry_points.txt +0 -0
- {dbos-0.27.0a11.dist-info → dbos-0.27.1.dist-info}/licenses/LICENSE +0 -0
dbos/_admin_server.py
CHANGED
@@ -66,11 +66,11 @@ class AdminRequestHandler(BaseHTTPRequestHandler):
|
|
66
66
|
elif self.path == _deactivate_path:
|
67
67
|
if not AdminRequestHandler.is_deactivated:
|
68
68
|
dbos_logger.info(
|
69
|
-
f"Deactivating DBOS executor {GlobalParams.executor_id} with version {GlobalParams.app_version}. This executor will complete existing workflows but will not
|
69
|
+
f"Deactivating DBOS executor {GlobalParams.executor_id} with version {GlobalParams.app_version}. This executor will complete existing workflows but will not create new workflows."
|
70
70
|
)
|
71
71
|
AdminRequestHandler.is_deactivated = True
|
72
|
-
# Stop all
|
73
|
-
for event in self.dbos.
|
72
|
+
# Stop all event receivers (scheduler and Kafka threads)
|
73
|
+
for event in self.dbos.poller_stop_events:
|
74
74
|
event.set()
|
75
75
|
self.send_response(200)
|
76
76
|
self._end_headers()
|
dbos/_core.py
CHANGED
dbos/_dbos.py
CHANGED
@@ -197,7 +197,7 @@ class DBOSRegistry:
|
|
197
197
|
self, evt: threading.Event, func: Callable[..., Any], *args: Any, **kwargs: Any
|
198
198
|
) -> None:
|
199
199
|
if self.dbos and self.dbos._launched:
|
200
|
-
self.dbos.
|
200
|
+
self.dbos.poller_stop_events.append(evt)
|
201
201
|
self.dbos._executor.submit(func, *args, **kwargs)
|
202
202
|
else:
|
203
203
|
self.pollers.append((evt, func, args, kwargs))
|
@@ -330,7 +330,10 @@ class DBOS:
|
|
330
330
|
self._registry: DBOSRegistry = _get_or_create_dbos_registry()
|
331
331
|
self._registry.dbos = self
|
332
332
|
self._admin_server_field: Optional[AdminServer] = None
|
333
|
-
|
333
|
+
# Stop internal background threads (queue thread, timeout threads, etc.)
|
334
|
+
self.background_thread_stop_events: List[threading.Event] = []
|
335
|
+
# Stop pollers (event receivers) that can create new workflows (scheduler, Kafka)
|
336
|
+
self.poller_stop_events: List[threading.Event] = []
|
334
337
|
self.fastapi: Optional["FastAPI"] = fastapi
|
335
338
|
self.flask: Optional["Flask"] = flask
|
336
339
|
self._executor_field: Optional[ThreadPoolExecutor] = None
|
@@ -502,7 +505,7 @@ class DBOS:
|
|
502
505
|
|
503
506
|
# Start the queue thread
|
504
507
|
evt = threading.Event()
|
505
|
-
self.
|
508
|
+
self.background_thread_stop_events.append(evt)
|
506
509
|
bg_queue_thread = threading.Thread(
|
507
510
|
target=queue_thread, args=(evt, self), daemon=True
|
508
511
|
)
|
@@ -515,7 +518,7 @@ class DBOS:
|
|
515
518
|
dbos_domain = os.environ.get("DBOS_DOMAIN", "cloud.dbos.dev")
|
516
519
|
self.conductor_url = f"wss://{dbos_domain}/conductor/v1alpha1"
|
517
520
|
evt = threading.Event()
|
518
|
-
self.
|
521
|
+
self.background_thread_stop_events.append(evt)
|
519
522
|
self.conductor_websocket = ConductorWebsocket(
|
520
523
|
self,
|
521
524
|
conductor_url=self.conductor_url,
|
@@ -527,7 +530,7 @@ class DBOS:
|
|
527
530
|
|
528
531
|
# Grab any pollers that were deferred and start them
|
529
532
|
for evt, func, args, kwargs in self._registry.pollers:
|
530
|
-
self.
|
533
|
+
self.poller_stop_events.append(evt)
|
531
534
|
poller_thread = threading.Thread(
|
532
535
|
target=func, args=args, kwargs=kwargs, daemon=True
|
533
536
|
)
|
@@ -583,7 +586,9 @@ class DBOS:
|
|
583
586
|
|
584
587
|
def _destroy(self) -> None:
|
585
588
|
self._initialized = False
|
586
|
-
for event in self.
|
589
|
+
for event in self.poller_stop_events:
|
590
|
+
event.set()
|
591
|
+
for event in self.background_thread_stop_events:
|
587
592
|
event.set()
|
588
593
|
self._background_event_loop.stop()
|
589
594
|
if self._sys_db_field is not None:
|
dbos/_recovery.py
CHANGED
@@ -29,7 +29,7 @@ def startup_recovery_thread(
|
|
29
29
|
) -> None:
|
30
30
|
"""Attempt to recover local pending workflows on startup using a background thread."""
|
31
31
|
stop_event = threading.Event()
|
32
|
-
dbos.
|
32
|
+
dbos.background_thread_stop_events.append(stop_event)
|
33
33
|
while not stop_event.is_set() and len(pending_workflows) > 0:
|
34
34
|
try:
|
35
35
|
for pending_workflow in list(pending_workflows):
|
@@ -1,19 +1,19 @@
|
|
1
|
-
dbos-0.27.
|
2
|
-
dbos-0.27.
|
3
|
-
dbos-0.27.
|
4
|
-
dbos-0.27.
|
1
|
+
dbos-0.27.1.dist-info/METADATA,sha256=wKicsi_27L1ILS4hNRfiLMToG59MKgfaWkIcEFFoHIE,5551
|
2
|
+
dbos-0.27.1.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
dbos-0.27.1.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
|
4
|
+
dbos-0.27.1.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
|
5
5
|
dbos/__init__.py,sha256=-FdBlOlr-f2tY__C23J4v22MoCAXqcDN_-zXsJXdoZ0,1005
|
6
6
|
dbos/__main__.py,sha256=G7Exn-MhGrVJVDbgNlpzhfh8WMX_72t3_oJaFT9Lmt8,653
|
7
|
-
dbos/_admin_server.py,sha256=
|
7
|
+
dbos/_admin_server.py,sha256=CM02jyC9H21fM7Pjn1BhPxNwAOV7CXmMJd0SdaNq8dQ,9062
|
8
8
|
dbos/_app_db.py,sha256=3j8_5-MlSDY0otLRszFE-GfenU6JC20fcfSL-drSNYk,11800
|
9
9
|
dbos/_classproperty.py,sha256=f0X-_BySzn3yFDRKB2JpCbLYQ9tLwt1XftfshvY7CBs,626
|
10
10
|
dbos/_client.py,sha256=Id-jzAUH6JMN-9WmAGyo0vm-nc0URjNIVwA2iKnCN5Q,13418
|
11
11
|
dbos/_conductor/conductor.py,sha256=HYzVL29IMMrs2Mnms_7cHJynCnmmEN5SDQOMjzn3UoU,16840
|
12
12
|
dbos/_conductor/protocol.py,sha256=zEKIuOQdIaSduNqfZKpo8PSD9_1oNpKIPnBNCu3RUyE,6681
|
13
13
|
dbos/_context.py,sha256=5aJHOjh6-2Zc7Fwzw924Vg0utLEkaR-oBMRdz3cE95k,23680
|
14
|
-
dbos/_core.py,sha256=
|
14
|
+
dbos/_core.py,sha256=iTcyDhi2nNgYaZqEOjlggjg9HyqKFliaROpjzyJOsik,48443
|
15
15
|
dbos/_croniter.py,sha256=XHAyUyibs_59sJQfSNWkP7rqQY6_XrlfuuCxk4jYqek,47559
|
16
|
-
dbos/_dbos.py,sha256=
|
16
|
+
dbos/_dbos.py,sha256=I3apaZar0137U8Edlnoxi8Zgh1Czy9AsDKlROG0kQu8,48701
|
17
17
|
dbos/_dbos_config.py,sha256=L0Z0OOB5FoPM9g-joZqXGeJnlxWQsEUtgPtgtg9Uf48,21732
|
18
18
|
dbos/_debug.py,sha256=MNlQVZ6TscGCRQeEEL0VE8Uignvr6dPeDDDefS3xgIE,1823
|
19
19
|
dbos/_docker_pg_helper.py,sha256=NmcgqmR5rQA_4igfeqh8ugNT2z3YmoOvuep_MEtxTiY,5854
|
@@ -38,7 +38,7 @@ dbos/_migrations/versions/eab0cc1d9a14_job_queue.py,sha256=uvhFOtqbBreCePhAxZfIT
|
|
38
38
|
dbos/_migrations/versions/f4b9b32ba814_functionname_childid_op_outputs.py,sha256=m90Lc5YH0ZISSq1MyxND6oq3RZrZKrIqEsZtwJ1jWxA,1049
|
39
39
|
dbos/_outcome.py,sha256=EXxBg4jXCVJsByDQ1VOCIedmbeq_03S6d-p1vqQrLFU,6810
|
40
40
|
dbos/_queue.py,sha256=aKCGahWBGJOLOv5PCOOId96Va3YQ4ICuHWXy-eQXohE,3526
|
41
|
-
dbos/_recovery.py,sha256=
|
41
|
+
dbos/_recovery.py,sha256=jVMexjfCCNopzyn8gVQzJCmGJaP9G3C1EFaoCQ_Nh7g,2564
|
42
42
|
dbos/_registrations.py,sha256=EZzG3ZfYmWA2bHX2hpnSIQ3PTi3-cXsvbcmXjyOusMk,7302
|
43
43
|
dbos/_request.py,sha256=cX1B3Atlh160phgS35gF1VEEV4pD126c9F3BDgBmxZU,929
|
44
44
|
dbos/_roles.py,sha256=iOsgmIAf1XVzxs3gYWdGRe1B880YfOw5fpU7Jwx8_A8,2271
|
@@ -67,4 +67,4 @@ dbos/cli/cli.py,sha256=a3rUrHog5-e22KjjUPOuTjH20PmUgSP0amRpMd6LVJE,18882
|
|
67
67
|
dbos/dbos-config.schema.json,sha256=8KcwJb_sQc4-6tQG2TLmjE_nratfrQa0qVLl9XPsvWE,6367
|
68
68
|
dbos/py.typed,sha256=QfzXT1Ktfk3Rj84akygc7_42z0lRpCq0Ilh8OXI6Zas,44
|
69
69
|
version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
|
70
|
-
dbos-0.27.
|
70
|
+
dbos-0.27.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|