dbos 1.2.0a9__py3-none-any.whl → 1.3.0a1__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.
dbos/_sys_db.py CHANGED
@@ -1385,35 +1385,35 @@ class SystemDatabase:
1385
1385
  payload = f"{workflow_uuid}::{topic}"
1386
1386
  condition = threading.Condition()
1387
1387
  # Must acquire first before adding to the map. Otherwise, the notification listener may notify it before the condition is acquired and waited.
1388
- condition.acquire()
1389
- success, _ = self.notifications_map.set(payload, condition)
1390
- if not success:
1391
- # This should not happen, but if it does, it means the workflow is executed concurrently.
1392
- condition.release()
1393
- self.notifications_map.pop(payload)
1394
- raise DBOSWorkflowConflictIDError(workflow_uuid)
1388
+ try:
1389
+ condition.acquire()
1390
+ success, _ = self.notifications_map.set(payload, condition)
1391
+ if not success:
1392
+ # This should not happen, but if it does, it means the workflow is executed concurrently.
1393
+ raise DBOSWorkflowConflictIDError(workflow_uuid)
1395
1394
 
1396
- # Check if the key is already in the database. If not, wait for the notification.
1397
- init_recv: Sequence[Any]
1398
- with self.engine.begin() as c:
1399
- init_recv = c.execute(
1400
- sa.select(
1401
- SystemSchema.notifications.c.topic,
1402
- ).where(
1403
- SystemSchema.notifications.c.destination_uuid == workflow_uuid,
1404
- SystemSchema.notifications.c.topic == topic,
1405
- )
1406
- ).fetchall()
1395
+ # Check if the key is already in the database. If not, wait for the notification.
1396
+ init_recv: Sequence[Any]
1397
+ with self.engine.begin() as c:
1398
+ init_recv = c.execute(
1399
+ sa.select(
1400
+ SystemSchema.notifications.c.topic,
1401
+ ).where(
1402
+ SystemSchema.notifications.c.destination_uuid == workflow_uuid,
1403
+ SystemSchema.notifications.c.topic == topic,
1404
+ )
1405
+ ).fetchall()
1407
1406
 
1408
- if len(init_recv) == 0:
1409
- # Wait for the notification
1410
- # Support OAOO sleep
1411
- actual_timeout = self.sleep(
1412
- workflow_uuid, timeout_function_id, timeout_seconds, skip_sleep=True
1413
- )
1414
- condition.wait(timeout=actual_timeout)
1415
- condition.release()
1416
- self.notifications_map.pop(payload)
1407
+ if len(init_recv) == 0:
1408
+ # Wait for the notification
1409
+ # Support OAOO sleep
1410
+ actual_timeout = self.sleep(
1411
+ workflow_uuid, timeout_function_id, timeout_seconds, skip_sleep=True
1412
+ )
1413
+ condition.wait(timeout=actual_timeout)
1414
+ finally:
1415
+ condition.release()
1416
+ self.notifications_map.pop(payload)
1417
1417
 
1418
1418
  # Transactionally consume and return the message if it's in the database, otherwise return null.
1419
1419
  with self.engine.begin() as c:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbos
3
- Version: 1.2.0a9
3
+ Version: 1.3.0a1
4
4
  Summary: Ultra-lightweight durable execution in Python
5
5
  Author-Email: "DBOS, Inc." <contact@dbos.dev>
6
6
  License: MIT
@@ -1,7 +1,7 @@
1
- dbos-1.2.0a9.dist-info/METADATA,sha256=ubEiLiylZ-mD87L2o3PiuuBvrO2dmgVy3N4Y8-_pvp8,13267
2
- dbos-1.2.0a9.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
- dbos-1.2.0a9.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
4
- dbos-1.2.0a9.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
1
+ dbos-1.3.0a1.dist-info/METADATA,sha256=HffHfk9xcviv8ws7LqIGcPYBSY7mkbgU23YENeEY2eE,13267
2
+ dbos-1.3.0a1.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
+ dbos-1.3.0a1.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
4
+ dbos-1.3.0a1.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
5
5
  dbos/__init__.py,sha256=NssPCubaBxdiKarOWa-wViz1hdJSkmBGcpLX_gQ4NeA,891
6
6
  dbos/__main__.py,sha256=G7Exn-MhGrVJVDbgNlpzhfh8WMX_72t3_oJaFT9Lmt8,653
7
7
  dbos/_admin_server.py,sha256=TWXi4drrzKFpKkUmEJpJkQBZxAtOalnhtYicEn2nDK0,10618
@@ -47,7 +47,7 @@ dbos/_schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  dbos/_schemas/application_database.py,sha256=SypAS9l9EsaBHFn9FR8jmnqt01M74d9AF1AMa4m2hhI,1040
48
48
  dbos/_schemas/system_database.py,sha256=3Z0L72bOgHnusK1hBaETWU9RfiLBP0QnS-fdu41i0yY,5835
49
49
  dbos/_serialization.py,sha256=bWuwhXSQcGmiazvhJHA5gwhrRWxtmFmcCFQSDJnqqkU,3666
50
- dbos/_sys_db.py,sha256=dNb2xeidel6-YEApxFCN0TTJZNpYr6Wc8LdFvX3pEb4,85730
50
+ dbos/_sys_db.py,sha256=KP2wIoytbtFoNzx3-SmobkAn3HhE6tZy_9Vvh8qpUQ8,85780
51
51
  dbos/_templates/dbos-db-starter/README.md,sha256=GhxhBj42wjTt1fWEtwNriHbJuKb66Vzu89G4pxNHw2g,930
52
52
  dbos/_templates/dbos-db-starter/__package/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  dbos/_templates/dbos-db-starter/__package/main.py.dbos,sha256=aQnBPSSQpkB8ERfhf7gB7P9tsU6OPKhZscfeh0yiaD8,2702
@@ -67,4 +67,4 @@ dbos/cli/cli.py,sha256=EemOMqNpzSU2BQhAxV_e59pBRITDLwt49HF6W3uWBZg,20775
67
67
  dbos/dbos-config.schema.json,sha256=CjaspeYmOkx6Ip_pcxtmfXJTn_YGdSx_0pcPBF7KZmo,6060
68
68
  dbos/py.typed,sha256=QfzXT1Ktfk3Rj84akygc7_42z0lRpCq0Ilh8OXI6Zas,44
69
69
  version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
70
- dbos-1.2.0a9.dist-info/RECORD,,
70
+ dbos-1.3.0a1.dist-info/RECORD,,
File without changes