Skip to content

Commit 43060c4

Browse files
BUG FIX: run() for BatchtoolsFuture would update the RNG state, if the future would attach packages. This was because batchtools::saveRegistry() forwards the RNG state
1 parent 070b5d8 commit 43060c4

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future.batchtools
2-
Version: 0.12.0
2+
Version: 0.11.0-9011
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
* Improved performance of batchtools futures by making the removal of
1212
the **batchtools** registry about 10-15 times faster.
1313

14+
## Bug Fixes
15+
16+
* `run()` for `BatchtoolsFuture` would update the RNG state, if the
17+
future would attach packages.
18+
1419

1520
# Version 0.11.0 [2022-12-13]
1621

R/BatchtoolsFuture-class.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,9 @@ run.BatchtoolsFuture <- function(future, ...) {
500500
## will have the same state of (loaded, attached) packages.
501501

502502
reg$packages <- packages
503-
saveRegistry(reg = reg)
503+
with_stealth_rng({
504+
saveRegistry(reg = reg)
505+
})
504506

505507
mdebugf("Attaching %d packages (%s) ... DONE",
506508
length(packages), hpaste(sQuote(packages)))

R/temp_registry.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ temp_registry <- local({
3333
if (length(config) > 0L) {
3434
names <- names(config)
3535
for (name in names) reg[[name]] <- config[[name]]
36-
saveRegistry(reg)
36+
with_stealth_rng({
37+
saveRegistry(reg)
38+
})
3739
}
3840

3941
reg

0 commit comments

Comments
 (0)