We test it in JRuby1.6.8, JRuby1.7.22 and Ruby 2.3.1,
they are correct.
And we find the source codes in jruby-9.1.2.0\lib\ruby\stdlib\logger.rb line 745
if /mswin|mingw/ =~ RUBY_PLATFORM
def lock_shift_log
yield
end
else
...
end
For Ruby, the value of RUBY_PLATFORM likes "x64-mingw32".
But for JRuby, the value of RUBY_PLATFORM is "java".
For test, we change if /mswin|mingw/ =~ RUBY_PLATFORM
to if /mswin|mingw|java/ =~ RUBY_PLATFORM
it is correct too.
So, is this a JRuby bug?
The text was updated successfully, but these errors were encountered:
smk0621
changed the title
Looger: log rotation inter-process lock failed. on Windows with JRuby 9.x
Logger: log rotation inter-process lock failed. on Windows with JRuby 9.x
Sep 13, 2016
@smk0621 Ahh yes, a platform check. I think the proper fix for this would be to modify the check to use RbConfig rather than RUBY_PLATFORM, probably something like this:
if/mswin|mingw/ =~ RbConfig::CONFIG['host_os']
This will work on all Ruby versions.
Wanna test this and put together a PR for us?
This is the sort of thing we're generally comfortable patching in our copy of MRI's stdlib, but we do usually try to get such changes upstreamed to MRI. We'll handle that at some point.
Environment
Provide at least:
Test Codes
Expected Behavior
Actual Behavior
We test it in JRuby1.6.8, JRuby1.7.22 and Ruby 2.3.1,
they are correct.
And we find the source codes in jruby-9.1.2.0\lib\ruby\stdlib\logger.rb line 745
For Ruby, the value of RUBY_PLATFORM likes "x64-mingw32".
But for JRuby, the value of RUBY_PLATFORM is "java".
For test, we change
if /mswin|mingw/ =~ RUBY_PLATFORM
to
if /mswin|mingw|java/ =~ RUBY_PLATFORM
it is correct too.
So, is this a JRuby bug?
The text was updated successfully, but these errors were encountered: