HenrikBengtsson / future.BatchJobs

:rocket: R package: future.BatchJobs: A Future API for Parallel and Distributed Processing using BatchJobs [Intentionally archived on CRAN on 2021-01-08]
https://cran.r-project.org/package=future.BatchJobs
8 stars 0 forks source link

Separate .async/ subdirectory for each R session #44

Closed HenrikBengtsson closed 8 years ago

HenrikBengtsson commented 8 years ago

Currently the async package puts all BatchJobs directories directly under ./async/. If one run several R sessions each utilizing async, then it is very hard to know which BatchJobs directory belongs to which R session. If one of the R session is aborted, it will fail to garbage collect meaning all its BatchJobs directories will also remain.

Suggestion: Have each R session use a unique ./async/async_<unique_id>/ directory.

HenrikBengtsson commented 8 years ago

Done. However, this introduces another problem which is that the session-specific ./async/async_<unique_id>/ directory remains after the session exits. Thus, overtime there will be many such left-over directories.

HenrikBengtsson commented 8 years ago

Added .onUnload() that tries to clean up the session-specific BatchJobs root directory when package is unloaded/no longer needed, cf. commit 10a81ee6e.

HenrikBengtsson commented 8 years ago

Now using timestamp and unique id, e.g. .async/20160102_154202-IVBRy1/