HenrikBengtsson / parallelly

R package: parallelly - Enhancing the 'parallel' Package
https://parallelly.futureverse.org
130 stars 7 forks source link

makeNodePSOCK(): Input errors such as invalid arguments should prevent retries #21

Closed HenrikBengtsson closed 4 years ago

HenrikBengtsson commented 4 years ago

Issue

makeClusterPSOCK() will try tries times, (3 times by default), if makeNodePSOCK() throws an error. However, some errors are not worth the retry, e.g. invalid argument values.

Action

Add a specific error class (e.g. "InvalidArgumentError") for each stop() that is not worth a retry. Update makeClusterPSOCK() to recognize this error class to prevent unnecessary retries.

Alternative, take the complementary approach and create a specific "PSOCKConnectionError" error class that is the only type of error for which we should retry. This can be done by upgrading the error objects thrown in

https://github.com/HenrikBengtsson/parallelly/blob/32bf898d76fee4c00027c8a991c15dec96a71d42/R/makeClusterPSOCK.R#L973