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
If some exception with positional arguments is being raised by a subprocess, this exception is not being raised correctly. Most of the times it even causes deadlocks in my attempts to create minimum reproducable examples.
from mpire import WorkerPool
class MyException1(Exception):
def __init__(self, a, b):
self.a = a
self.b = b
super().__init__(f"a={self.a}, b={self.b}")
class MyException2(Exception):
def __init__(self, a):
self.a = a
super().__init__(f"a={self.a}")
def work1(x):
raise MyException2(x)
def work2(x):
raise MyException2(x, x)
with WorkerPool(n_jobs=5, use_dill=False) as pool:
for res in pool.imap(work1, range(10)):
if isinstance(res, Exception):
raise res
else:
print(res)
The text was updated successfully, but these errors were encountered:
I can confirm that this isn't working as expected. For some reason, I dismissed exceptions that have init arguments as an option. I will see if I can fix this.
If some exception with positional arguments is being raised by a subprocess, this exception is not being raised correctly. Most of the times it even causes deadlocks in my attempts to create minimum reproducable examples.
In case the exception takes exactly one argument, the exception message might be wrong. In case it takes more than one mandatory positional arguments the reraising will fail, because in following line the exception is assumed to take exactly one argument (the exception message)
https://github.com/Slimmer-AI/mpire/blob/0041051aaf4acf83e4c7e106a4f651d7ee6f3f26/mpire/pool.py#L752
Minimal examples:
The text was updated successfully, but these errors were encountered: