When Using JRuby 9.3.0.0 in Windows this error occurs.
Reproduction steps:
1) Test script:
`test_logger.rb
logger = Logger.new("D:/log.txt", 5, 1024)
150.times do |i|
logger.info i
end
2) run script:
The easiest way to run JRuby in windows would be installing Java 11 and downloading jruby-complete-9.3.0.0.jar, then run:
D:\>java -jar jruby-complete-9.3.0.0.jar test_logger.rb
3) Console output:
log rotation inter-process lock failed. D:\log.txt -> D:\log.txt.0: The process cannot access the file because it is being used by another process.
log writing failed. closed stream
log shifting failed. closed stream
log writing failed. closed stream
log shifting failed. closed stream
...
4) Cause:
The issue occurs due JRuby returns java for RUBY_PLATFORM when loading the method lock_shift_log
When Using JRuby 9.3.0.0 in Windows this error occurs.
Reproduction steps:
1) Test script:
`test_logger.rb
2) run script:
The easiest way to run JRuby in windows would be installing Java 11 and downloading
jruby-complete-9.3.0.0.jar, then run:3) Console output:
log rotation inter-process lock failed. D:\log.txt -> D:\log.txt.0: The process cannot access the file because it is being used by another process.
log writing failed. closed stream
log shifting failed. closed stream
log writing failed. closed stream
log shifting failed. closed stream
...
4) Cause:
The issue occurs due JRuby returns
javaforRUBY_PLATFORMwhen loading the methodlock_shift_log