You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
I am using starmap method in ZPool for passing multiple arguments, which is the same method we would be using in the multiprocessing library, but here when I pass the values as mentioned, it is failing and running infinitely!
A simple example code I am using is,
import fiber
from fiber.pool import Pool
@fiber.meta(cpu=1)
def add(a, b):
return a + b
if __name__ == "__main__":
pool = Pool(processes=4)
ans = pool.starmap(add, [(1, 2), (4, 5)])
The exception I am getting is,
Exception in Process(PoolWorker-4, 24266)>:
Traceback (most recent call last):
File "/Users/arjun/environments/fibertest/lib/python3.6/site-packages/fiber/process.py", line 289, in _bootstrap
self.run()
File "/Users/arjun/environments/fibertest/lib/python3.6/site-packages/fiber/process.py", line 185, in run
return super().run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/Users/arjun/environments/fibertest/lib/python3.6/site-packages/fiber/pool.py", line 858, in zpool_worker
wrap_exception, 0, req=req)
File "/Users/arjun/environments/fibertest/lib/python3.6/site-packages/fiber/pool.py", line 801, in zpool_worker_core
res = func(*args, **kwds)
TypeError: add() argument after ** must be a mapping, not tuple
And it is being printed indefinitely!
I am doing something wrong here ? Or is this an issue ?
The text was updated successfully, but these errors were encountered:
Thanks for reporting this error. It seems to be a bug in handling starmap when chunksize is not 1. I'll create a fix for it later. In the mean time, you can set the chunksize argument of starmap to 1 explicitly work around this bug. For example:
I am using
starmap
method in ZPool for passing multiple arguments, which is the same method we would be using in the multiprocessing library, but here when I pass the values as mentioned, it is failing and running infinitely!A simple example code I am using is,
The exception I am getting is,
And it is being printed indefinitely!
I am doing something wrong here ? Or is this an issue ?
The text was updated successfully, but these errors were encountered: