Implement lab7 mTLS, scoped OpenBao secrets and worker compromise experiment

This commit is contained in:
2026-11-13 01:12:35 +03:00
parent 20afc2c790
commit 46806a5c37
120 changed files with 10228 additions and 74 deletions
+16
View File
@@ -0,0 +1,16 @@
"""Keep resource leases until a blocking operation actually finishes on cancellation."""
import asyncio
async def complete_thread(function, *args):
task = asyncio.create_task(asyncio.to_thread(function, *args))
try:
return await asyncio.shield(task)
except asyncio.CancelledError:
# asyncio cancellation cannot stop a Python thread. Do not close its file
# or release its decoder/upload permit while it is still using them.
try:
await asyncio.shield(task)
except Exception:
pass
raise