Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4567 +/- ##
==========================================
+ Coverage 97.72% 97.73% +0.01%
==========================================
Files 298 299 +1
Lines 62352 62453 +101
==========================================
+ Hits 60934 61040 +106
+ Misses 1418 1413 -5
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
| dmon.share('item', item) | ||
|
|
||
| # bind last so we're ready to go... | ||
| await dmon.listen(f'unix://{sockpath}') |
There was a problem hiding this comment.
In the event of a failure to open this listening socket, how does the application respond?
In the base cell and the default listening socket, we warn about a failure to open the default listener, but that isn't quite so fatal since regular telepath / http api listeners are going to work. In this case, it feels much more fatal.
| class FileDrive(Drive, s_spawner.SpawnerMixin): | ||
|
|
||
| async def __anit__(self, path): | ||
| slab = await s_lmdbslab.Slab.anit(path) |
There was a problem hiding this comment.
There is no fini handler registered for this Slab that I can find?
|
|
||
| async def __anit__(self, path): | ||
| slab = await s_lmdbslab.Slab.anit(path) | ||
| return await Drive.__anit__(self, slab, 'celldrive') |
There was a problem hiding this comment.
I don't think anit would normally have anything to return?
|
|
||
| base.schedCoro(s_process.spawn((_ioWorkProc, (todo, sockpath), {}))) | ||
|
|
||
| await s_link.unixwait(sockpath) |
There was a problem hiding this comment.
I believe that if the schedCoro has an error + infinite loop of unixwait means that it is possible to have a situation where we have blindly blocked execution of the application?
| path = s_common.gendir(self.dirn, 'slabs', 'drive.lmdb') | ||
| sockpath = s_common.genpath(self.sockdirn, 'drive') | ||
|
|
||
| if len(sockpath) > s_const.UNIX_PATH_MAX: |
There was a problem hiding this comment.
it feels like this check should be in the spawner.py to prevent the multiprocess target from getting bad input?
| MAX_FIELD_SIZE = kibibyte * 64 | ||
|
|
||
| # Socket constants | ||
| UNIX_PATH_MAX = 107 |
There was a problem hiding this comment.
BSD derivatives ( which I believe there may be at least one Cortex deployment on in the wild ) have a maxlenth of 104 characters, vs the linux 108. We probably need to be conservative with this value and set it to 103.
| info = {'path': path, 'unix': True} | ||
| return await Link.anit(reader, writer, info=info) | ||
|
|
||
| async def unixwait(path): |
There was a problem hiding this comment.
we should be able to write a test for this in test_lib_link that does the following:
- create a base
- create the path we're going to listen on
- spawn a schedcoro waiting for the listening path which blocks on unixwait
- startup the unix listener
- waits for the schedCoro task a limited amount of time.
| # The scope data set in the task is not present outside of it. | ||
| self.none(s_scope.get('hehe')) | ||
|
|
||
| async def test_base_spawner_fini(self): |
There was a problem hiding this comment.
Should this be moved to test_lib_spawner.py ? Its no longer a part of the Base object.
No description provided.