Skip to content
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

get_id() subtly alters the session randomization state #386

Closed
MichaelChirico opened this issue Apr 2, 2024 · 2 comments
Closed

get_id() subtly alters the session randomization state #386

MichaelChirico opened this issue Apr 2, 2024 · 2 comments

Comments

@MichaelChirico
Copy link

paste(sample(c(LETTERS, 0:9), 10, replace = TRUE), collapse = ""),

Started way upstream as r-lib/pkgload#272 and then r-lib/pkgbuild#185, but the issue traces back to the above -- while trying to build a package, {processx} generates this random ID which messes with the randomization state of the session.

I don't see this documented as intended behavior, so I'm wondering if this is unintentional & perhaps get_id() should be careful to restore the randomization state on completion; of course this means consecutive runs of {processx} may generate sessions with the same ID --> not desirable, so maybe the caller needs to deal with this & {processx} just needs to document the issue?

Alternatively, maybe get_id() could use the tempfile() randomization to generate the IDs, since tempfile() does not touch the R-level randomization state?

@luwidmer
Copy link

luwidmer commented Jan 7, 2025

@gaborcsardi it looks like this fix has not landed on CRAN yet? I just tracked down an irreproducible first model fit in the {rbmi} package to this issue (see link above), and installing the current version off Github using remotes::install_github does fix it.

@luwidmer
Copy link

luwidmer commented Jan 9, 2025

Many thanks for releasing 3.8.5, @gaborcsardi 🎉!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants