-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crew worker does not actually heed reset_packages = FALSE
, reset_globals = FALSE
etc
#143
Comments
I think crew <- crew::crew_controller_local(
name = "user",
workers = 1,
local_log_directory = "crew_logs",
reset_globals = FALSE
)
crew$start()
crew$push(
name = "add_the_data",
command = the_data,
globals = list(the_data = "test")
)
crew$wait()
a <- crew$pop()
a$result[[1]]
#> [1] "test"
a$error
#> [1] NA
crew$push(
name = "verify_the_data",
the_data
)
crew$wait()
b <- crew$pop()
b$result[[1]]
#> [1] "test"
b$error
#> [1] NA
crew$push(
name = "verify_the_data_again",
the_data
)
crew$wait()
c <- crew$pop()
c$result[[1]]
#> [1] "test"
c$error
#> [1] NA Created on 2024-01-26 with reprex v2.1.0 And with crew <- crew::crew_controller_local(
name = "user",
workers = 1,
local_log_directory = "crew_logs",
reset_globals = TRUE
)
crew$start()
crew$push(
name = "add_the_data",
command = the_data,
globals = list(the_data = "test")
)
crew$wait()
a <- crew$pop()
a$result[[1]]
#> [1] "test"
a$error
#> [1] NA
crew$push(
name = "verify_the_data",
the_data
)
crew$wait()
b <- crew$pop()
b$result[[1]]
#> [1] NA
b$error
#> [1] "object 'the_data' not found"
crew$push(
name = "verify_the_data_again",
the_data
)
crew$wait()
c <- crew$pop()
c$result[[1]]
#> [1] NA
c$error
#> [1] "object 'the_data' not found" Created on 2024-01-26 with reprex v2.1.0 |
Neither |
Hi @wlandau,
The reprex demonstrates how it is indeed resetting the value in the package though, possibly by reloading the package? The code written to the package in the reprex above creates an environment when the In the first task, we pass a variable into the crew task which is then assigned by that function to the environment internal to the package. In your reprex, you pass the variable to each subsequent If Does the issue make more sense now? |
As written originally in #143 (comment), your test with packages also uses |
@wlandau Ahh, the worker is closing out 10s after every task and that's why the packages refresh when loaded each time. Got it, thank you! |
Hi
crew
devs,I think I've encountered a bug based on what the documentation suggests for
reset_packages
&reset_globals
arguments tocrew_controller_local
. Reprexes belowPrework
crew
package itself and not a user error, known limitation, or issue from another package thatcrew
depends on. For example, if you get errors runningtar_make_clustermq()
, try isolating the problem in a reproducible example that runsclustermq
and notcrew
. And for miscellaneous troubleshooting, please post to discussions instead of issues.Description
Every task allocated to the worker resets the packages and globals, there is nothing that persists between tasks pushed to the worker.
Reproducible example for globals
Expected result
the_data
persists as a global on the worker between subsequent tasks allocated to the worker.However, though it will occasionally persist on one subsequent task
verify_the_data
, by the final task:verify_the_data_again
The result will beNA
because the global has disappeared.The same is true for packages.
Reprex for packages
Expected result
The variable assigned to the value in the internal environment of the package persists between tasks at least once, but it returns
NULL
by the second task.Diagnostic information
Diagnostic information
GithubSHA: f31eea1 Latest
The text was updated successfully, but these errors were encountered: