I have a short code that uses the multiprocessing
package and works fine on my local machine.
When I uploaded to AWS Lambda
and run there, I got the following error (stacktrace trimmed):
[Errno 38] Function not implemented: OSError
Traceback (most recent call last):
File "/var/task/recorder.py", line 41, in record
pool = multiprocessing.Pool(10)
File "/usr/lib64/python2.7/multiprocessing/__init__.py", line 232, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild)
File "/usr/lib64/python2.7/multiprocessing/pool.py", line 138, in __init__
self._setup_queues()
File "/usr/lib64/python2.7/multiprocessing/pool.py", line 234, in _setup_queues
self._inqueue = SimpleQueue()
File "/usr/lib64/python2.7/multiprocessing/queues.py", line 354, in __init__
self._rlock = Lock()
File "/usr/lib64/python2.7/multiprocessing/synchronize.py", line 147, in __init__
SemLock.__init__(self, SEMAPHORE, 1, 1)
File "/usr/lib64/python2.7/multiprocessing/synchronize.py", line 75, in __init__
sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
OSError: [Errno 38] Function not implemented
Can it be that a part of python's core packages in not implemented? I have no idea what am I running on underneath so I can't login there and debug.
Any ideas how can I run multiprocessing
on Lambda?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…