MillenniumForce / overkill

Overkill lets you run parallel processes accross computers
https://millenniumforce.github.io/overkill
0 stars 0 forks source link

Errors in _delegate_work should raise a WorkError #32

Closed MillenniumForce closed 2 years ago

MillenniumForce commented 2 years ago

Description

Errors raised in _delegate_task should be returned back to the user

Add try... except in 144-147: https://github.com/MillenniumForce/overkill/blob/f24fa49463d85c961a72bfc9b768bb5730136c2f/overkill/servers/_master.py#L144-L147

What I Did

Passed array first instead of function: cc.map(arr, f) raises an exception that is not caught and raised with the user.

Logs:

INFO 2022-04-23 14:18:37,960 - Could not handle request: object of type 'function' has no len()
INFO 2022-04-23 14:18:37,965 - Traceback (most recent call last):
  File "/Users/juliangarratt/Desktop/overkill/overkill/servers/_master.py", line 67, in handle
    work_id = _delegate_task(ask)
  File "/Users/juliangarratt/Desktop/overkill/overkill/servers/_utils.py", line 134, in newFunction
    return f(*args, **kw)
  File "/Users/juliangarratt/Desktop/overkill/overkill/servers/_master.py", line 145, in _delegate_task
    len(array), _resources)
TypeError: object of type 'function' has no len()