You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> jruby -v
jruby 9.1.8.0 (2.3.1) 2017-03-06 90fc7ab Java HotSpot(TM) 64-Bit Server VM 25.66-b18 on 1.8.0_66-b18 +jit [mswin32-x86_64]
JRUBY_OPTS=-J-Xms512m -J-Xmx1024m -J-XX:+HeapDumpOnOutOfMemoryError -J-XX:HeapDumpPath=C:/Users/AnthonySchmieder/Desktop/tmp/jruby_hprofs/jruby_jvm_heap_dump.hprof -Xnative.verbose=true
Rails 4.2.7.1
RSpec 3.5.0
Windows 10
Expected Behavior
Time.now returns the time
Actual Behavior
This looks related to #4501. We have an RSpec test for a class that calls Rails.cache.fetch. Sometimes that call attmpts to call the libc gettimeofday method and throws a NotImplementedError. I have not been able to determine the factors that make the call fail.
Here is the call stack:
NotImplementedError:
gettimeofday unsupported or native support failed to load; see http://wiki.jruby.org/Native-Libraries
# ./.gems/gems/activesupport-4.2.7.1/lib/active_support/cache.rb:612:in `initialize'
# ./.gems/gems/activesupport-4.2.7.1/lib/active_support/cache.rb:390:in `block in write'
# ./.gems/gems/activesupport-4.2.7.1/lib/active_support/cache.rb:547:in `block in instrument'
# ./.gems/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:166:in `instrument'
# ./.gems/gems/activesupport-4.2.7.1/lib/active_support/cache.rb:547:in `instrument'
# ./.gems/gems/activesupport-4.2.7.1/lib/active_support/cache.rb:389:in `write'
# ./.gems/gems/activesupport-4.2.7.1/lib/active_support/cache.rb:588:in `save_block_result_to_cache'
# ./.gems/gems/activesupport-4.2.7.1/lib/active_support/cache.rb:299:in `fetch'
# ./app/models/config/option.rb:223:in `index'
... more from our application code
The failing line in cache.rb::initialize is:
@created_at = Time.now.to_f
This fails deterministically (always on the same spec), but does not fail for all calls to Rails.cache.fetch. Also a call to Time.now placed immediately before the call to Rails.cache.fetch always works. Also there are no errors loading a POSIX implementation:
Successfully loaded native POSIX impl.
A workaround is to set native.enabled=false in my .jrubyrc.
The text was updated successfully, but these errors were encountered:
I think the best answer for us here, until we have gettimeofday modified to do the "right thing" on Windows, would be to make the Windows version just provide System.currentTimeMillis as the fallback code does.
Environment
Rails 4.2.7.1
RSpec 3.5.0
Windows 10
Expected Behavior
Time.now
returns the timeActual Behavior
This looks related to #4501. We have an RSpec test for a class that calls
Rails.cache.fetch
. Sometimes that call attmpts to call the libcgettimeofday
method and throws aNotImplementedError
. I have not been able to determine the factors that make the call fail.Here is the call stack:
The failing line in
cache.rb::initialize
is:This fails deterministically (always on the same spec), but does not fail for all calls to
Rails.cache.fetch
. Also a call toTime.now
placed immediately before the call toRails.cache.fetch
always works. Also there are no errors loading a POSIX implementation:A workaround is to set
native.enabled=false
in my .jrubyrc.The text was updated successfully, but these errors were encountered: