Is this ruby on rails code thread safe? -
i have issue logger
in jruby on rails app. 1 thread changes log level error , not change back. code threadsafe, or should other places happening?
https://github.com/rails/rails/blob/master/activesupport/lib/active_support/benchmarkable.rb#l50
def silence message = "activesupport::benchmarkable#silence deprecated. removed rails 4.1." activesupport::deprecation.warn message old_logger_level, logger.level = logger.level, ::logger::error if logger yield ensure logger.level = old_logger_level if logger end
ok, looks during yield
in first thread other thread silence
have logger.level
set error
, if other thread end after first one, set level error
permanently.
Comments
Post a Comment