spawn io worker for drive subsystem (SYN-10499)#4567
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4567 +/- ##
========================================
Coverage 97.74% 97.74%
========================================
Files 298 299 +1
Lines 62998 63142 +144
========================================
+ Hits 61576 61719 +143
- Misses 1422 1423 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
159b3bc to
83d686e
Compare
83d686e to
17a45f1
Compare
vEpiphyte
reviewed
Mar 4, 2026
vEpiphyte
reviewed
Mar 4, 2026
vEpiphyte
reviewed
Mar 4, 2026
vEpiphyte
reviewed
Mar 4, 2026
vEpiphyte
reviewed
Apr 3, 2026
vEpiphyte
reviewed
Apr 3, 2026
vEpiphyte
reviewed
Apr 3, 2026
…n provided (#4863) - [x] Drive - ensure that the setTypeSchema callback is a valid dyncoro when provided - [x] Dyndeps - add getDynCoro and reqDynCoro functions; add req* versions of dyn helpers, deprecated the try* versions.
…ze functions across a telepath boundary.
OCBender
reviewed
Apr 16, 2026
vEpiphyte
reviewed
Apr 16, 2026
Co-authored-by: blackout <blackout@vertex.link>
vEpiphyte
approved these changes
Apr 20, 2026
OCBender
approved these changes
Apr 20, 2026
OCBender
approved these changes
Apr 20, 2026
MichaelSquires
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This branch introduces a dedicated IO worker subprocess for the Cell Drive subsystem.
The Drive's LMDB slab is migrated out of the shared Cell slab into its own file
(
slabs/drive.lmdb) and is served from a separate process via Unix domain socketsand the existing Telepath RPC framework. The change also modernizes
dyndepsnamingconventions and improves subprocess coverage collection in CI.
New Files
synapse/lib/spawner.pySpawnerMixin,_ioWorkProc,_spawnerWait)synapse/tests/test_lib_spawner.pysynapse/tests/test_lib_drive.pytest_lib_cell.py) plus backup-sync test.coveragerc.mainchanges/c56856d0929e4a71fde0d98fc77ddeb5.yamlchanges/fb1de9c8091f353422a50736baf4d803.yamlChanged Files
synapse/lib/drive.pyFileDrivesubclass withSpawnerMixin; many sync methods converted to async; schema callback resolved viareqDynCoro; callback signature gainscurvparametersynapse/lib/cell.pyFileDrive.spawner();sockdirnfor Unix sockets;_driveCellMigrationcopies drive DB to dedicated slab;drive.sync()called in backup and shutdown paths; drive API calls changed from sync to asyncsynapse/lib/dyndeps.pygetDynCoro/reqDynCorofor async function import;tryDynMod/tryDynLocal/tryDynFuncdeprecated in favor ofreqDynMod/reqDynLocal/reqDynFunc; improved error messagessynapse/lib/link.pyunixwait()polling helper for socket availabilitysynapse/lib/const.pyUNIX_SOCKET_PATH_MAX = 103constantsynapse/cortex.pytryDynFunc->reqDynFuncsynapse/datamodel.pytryDynFunc->reqDynFuncsynapse/tools/storm/pkg/gen.pytryDynMod->reqDynModsynapse/tools/utils/autodoc.pytryDynLocal->reqDynLocalsynapse/tests/test_lib_cell.pytest_lib_drive.py); socket path constant updatedsynapse/tests/test_lib_base.pyHahaclass)synapse/tests/test_lib_dyndeps.pygetDynCoro/reqDynCoro/reqDynMod/reqDynLocal/reqDynFunc/runDynTaskerror pathssynapse/tests/test_lib_link.pyunixwait()synapse/tests/test_lib_agenda.pygetTestCorecontextsynapse/tests/test_lib_stormtypes.pygetTestCoreAndProxycontextsynapse/tests/test_lib_nexus.py3x->4x) to account for drive slab.circleci/config.ymlCOVERAGE_PROCESS_STARTadded;--cov-config=.coveragerc.mainfor main process.coveragercconcurrency = multiprocessing,parallel = True,sigterm = Truescripts/testrunner.sh--dist worksteal -n 8docs/conf.pySIGTERMwarning pattern added to ignore listCLAUDE.mdArchitectural Detail
Spawner Framework (
synapse/lib/spawner.py)SpawnerMixin.spawner(base, sockpath)returns a factory coroutine._spawn()which:__anit__constructor call as atodotuple./tmp/<guid>socket path if the configured path exceedsUNIX_SOCKET_PATH_MAX.s_process.spawn()running_ioWorkProc._spawnerWait(1-second poll, 30-second deadline).unix://<sockpath>:item._ioWorkProcrunsasyncio.run()in the subprocess, creates aDaemon, instantiates the target object, shares it, and listens on the Unix socket.Drive Migration (
cell.py+drive.py)_drivePermMigration): Migratesperm->permissionsfield (existing)._driveCellMigration): Copies all drive rows from the shared cell slab into a new dedicated slab atslabs/drive.lmdb, then drops the old DB.FileDrive.spawner()initializes the drive in a subprocess.Schema Callback Change
setTypeSchemacallbacks are now specified as importable Python dotted-path strings (e.g.,'synapse.tests.test_lib_drive.migrate_v1') instead of raw function references. They are resolved at call time viareqDynCoro, which validates that the target is an async coroutine function. The callback signature also gains a fourthcurvparameter (the current schema version before the upgrade).