Skip to content

docs: update shared-memory interface #222

Description

@degville

Please describe the question or issue you're facing with "shared-memory interface - Snap documentation".

To fix Python errors like the following:

ProcessPoolExecutor(max_workers=max_workers) as executor:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/python/lib/python3.11/concurrent/futures/process.py", line 732, in __init__
self._call_queue = _SafeQueue(
^^^^^^^^^^^
File "/opt/python/lib/python3.11/concurrent/futures/process.py", line 173, in __init__
super().__init__(max_size, ctx=ctx)
File "/opt/python/lib/python3.11/multiprocessing/queues.py", line 43, in __init__
self._rlock = ctx.Lock()
^^^^^^^^^^
File "/opt/python/lib/python3.11/multiprocessing/context.py", line 68, in Lock
return Lock(ctx=self.get_context())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/python/lib/python3.11/multiprocessing/synchronize.py", line 169, in __init__
SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)
File "/opt/python/lib/python3.11/multiprocessing/synchronize.py", line 57, in __init__
sl = self._semlock = _multiprocessing.SemLock(
^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied`

Useful for Python threading, set private to true and we bind mount the private dev shared directory.

Also, check with @bboozzoo that this actually works.


Reported from: https://snapcraft.io/docs/reference/interfaces/shared-memory-interface/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions