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

GH-16360: Fix R package for Windows #16369

Merged
merged 3 commits into from
Sep 18, 2024

Conversation

tomasfryda
Copy link
Contributor

#16360

The Windows usually don't allow opening one file by multiple processes and that seems to cause this issue.

In python, it seems like we are using the same process group which IIRC could mitigate the issue we're seeing in R.

Last time I programmed on Windows, Delphi was a big thing and Windows XP was the latest version so my knowledge of that "operating system" is pretty limited. So I'm trying to keep it simple and multiplatform without delving into windows' and R's internals.

My solution is to add the web_ip to the json we send when H2O connects and then check on R side if it's null and if so print the warning. This way we print it every time on h2o.init and also on h2o.connect (which I think is a good thing) but it makes the behavior between R and Python diverge a bit.

@mmalohlava JFYI this related to #15683 which you were involved in.

@tomasfryda tomasfryda self-assigned this Aug 17, 2024
valenad1
valenad1 previously approved these changes Aug 22, 2024
Copy link
Collaborator

@valenad1 valenad1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The solution with the log would be more general. But this will work also.

@tomasfryda tomasfryda added this to the 3.46.0.5 milestone Aug 22, 2024
@tomasfryda
Copy link
Contributor Author

I'm rerunning the tests since I didn't have the milestone assigned.

We could make this more general by adding a field "security_warnings" and send that on initialization.
On Windows with the current implementation (before this fix) the R starts h2o but doesn't connect to it which is bad since user can't use h2o and we might end up having a process that listens on all interfaces unmanaged without people knowing that it is running.

@wendycwong
Copy link
Contributor

@tomasfryda : I do have a windows machine. Let me know what tests you want to run on a windows machine to make sure everything works.

@tomasfryda
Copy link
Contributor Author

@wendycwong all you have to do is to install the package and call:

library(h2o)
h2o.init()

It should not fail with access denied.

It's probably not necessary to install the package but you have to call h2o.init() while there is no running instance of h2o backend otherwise it would try to connect to it.

I tested it like a month ago and actually thought this was already merged and released in 3.46.0.5.

@tomasfryda tomasfryda merged commit d2023b1 into rel-3.46.0 Sep 18, 2024
69 of 71 checks passed
@tomasfryda tomasfryda deleted the tomf_GH-16360_fix_R_on_windows branch September 18, 2024 11:47
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

Successfully merging this pull request may close these issues.

3 participants