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

ENV.replace not working as expected #4634

Closed
nateberkopec opened this issue May 30, 2017 · 6 comments
Closed

ENV.replace not working as expected #4634

nateberkopec opened this issue May 30, 2017 · 6 comments

Comments

@nateberkopec
Copy link

Environment

TravisCI build with failure

Expected/Actual Behavior

puma/puma#1305

@kares
Copy link
Member

kares commented May 31, 2017

Thanks Nate, reading through comments and some code its not clear what exactly is the problem.
Maybe a simple reproducable piece of .rb would be better than build/issue links, if you have some?

@preetpalS
Copy link

Aren't workers in Puma exclusive to Puma's clustered mode which is not supported when using JRuby due to a lack of fork(2)?

The single file (which is a test file) that changed in that referenced pull request seems to contain many instances of tests being skipped if JRuby and Windows are detected. Maybe this is an issue of code being run when it shouldn't.

@headius
Copy link
Member

headius commented Jun 6, 2017

Nothing obvious from the error, but this seems like some encoding oddity. However I was unable to make MRI produce any ENV strings in ASCII-8BIT, even when forced to be.

~/projects/jruby $ ruby -e 'p ENV["HOME"].encoding'
#<Encoding:UTF-8>

~/projects/jruby $ ruby -e 'ENV["HOME"] = "/Users/headius".force_encoding("ASCII-8BIT"); p ENV["HOME"].encoding'
#<Encoding:UTF-8>

~/projects/jruby $ ruby -e 'ENV["HOME"] = "/Users/headiusø".force_encoding("ASCII-8BIT"); p ENV["HOME"].encoding'
#<Encoding:UTF-8>

@headius
Copy link
Member

headius commented Jun 6, 2017

I'm confused about the line numbers in that build. When I clone puma master, there is no line 254 in test/test_integration.rb. The failing test is in there, but has a skip_jruby call. There's a comment about a bug on JRuby wrt setting nil or 'delete' not clearing values in ENV – and we should fix that – but I'm not sure if it has been filed anywhere.

So...not sure what to do on JRuby's end.

@nateberkopec
Copy link
Author

Thanks for looking at this guys. I filed this issue just kinda quickly so what looked like a possible JRuby bug didn't get lost in the shuffle. I'll do some work to clear things up on what's ahppening on our side.

@kares
Copy link
Member

kares commented Sep 25, 2018

recent Puma built seems to be all green using 9.1.17.0 as well as jruby-head (9.2.1.DEV)
since there wasn't more info I am inclined to close this one.

@kares kares added this to the Invalid or Duplicate milestone Sep 25, 2018
@headius headius closed this as completed Oct 9, 2018
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

4 participants