Project

General

Profile

Bug #9046

[PATCH] Inter-process locking for log rotation is required

Added by sonots (Naotoshi Seo) about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 2.1.0dev (2013-10-20 trunk 43373) [x86_64-darwin12.2.1]
[ruby-dev:47769]

Description

I sent a pull request on https://github.com/ruby/ruby/pull/428 . Please see details on it.


Related issues

Related to Ruby master - Bug #9130: logger continues to write in old log file after rotationClosed11/20/2013Actions

Associated revisions

Revision 0749adc5
Added by naruse (Yui NARUSE) about 6 years ago

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 43511
Added by naruse (Yui NARUSE) about 6 years ago

Revision 43511
Added by naruse (Yui NARUSE) about 6 years ago

Revision 43511
Added by naruse (Yui NARUSE) about 6 years ago

Revision 43511
Added by naruse (Yui NARUSE) about 6 years ago

Revision 43511
Added by naruse (Yui NARUSE) about 6 years ago

Revision 43511
Added by naruse (Yui NARUSE) about 6 years ago

Revision 3c807293
Added by nobu (Nobuyoshi Nakada) about 6 years ago

logger.rb: fix r43511 for Windows

  • lib/logger.rb (Logger::LogDevice::LogDeviceMutex#lock_shift_log): open file can't be removed or renamed on Windows. [ruby-dev:47790] [Bug #9046]
  • test/logger/test_logger.rb (TestLogDevice#run_children): don't use fork.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 43513
Added by nobu (Nobuyoshi Nakada) about 6 years ago

logger.rb: fix r43511 for Windows

  • lib/logger.rb (Logger::LogDevice::LogDeviceMutex#lock_shift_log): open file can't be removed or renamed on Windows. [ruby-dev:47790] [Bug #9046]
  • test/logger/test_logger.rb (TestLogDevice#run_children): don't use fork.

Revision 43513
Added by nobu (Nobuyoshi Nakada) about 6 years ago

logger.rb: fix r43511 for Windows

  • lib/logger.rb (Logger::LogDevice::LogDeviceMutex#lock_shift_log): open file can't be removed or renamed on Windows. [ruby-dev:47790] [Bug #9046]
  • test/logger/test_logger.rb (TestLogDevice#run_children): don't use fork.

Revision 43513
Added by nobu (Nobuyoshi Nakada) about 6 years ago

logger.rb: fix r43511 for Windows

  • lib/logger.rb (Logger::LogDevice::LogDeviceMutex#lock_shift_log): open file can't be removed or renamed on Windows. [ruby-dev:47790] [Bug #9046]
  • test/logger/test_logger.rb (TestLogDevice#run_children): don't use fork.

Revision 43513
Added by nobu (Nobuyoshi Nakada) about 6 years ago

logger.rb: fix r43511 for Windows

  • lib/logger.rb (Logger::LogDevice::LogDeviceMutex#lock_shift_log): open file can't be removed or renamed on Windows. [ruby-dev:47790] [Bug #9046]
  • test/logger/test_logger.rb (TestLogDevice#run_children): don't use fork.

Revision 43513
Added by nobu (Nobuyoshi Nakada) about 6 years ago

logger.rb: fix r43511 for Windows

  • lib/logger.rb (Logger::LogDevice::LogDeviceMutex#lock_shift_log): open file can't be removed or renamed on Windows. [ruby-dev:47790] [Bug #9046]
  • test/logger/test_logger.rb (TestLogDevice#run_children): don't use fork.

Revision 43513
Added by nobu (Nobuyoshi Nakada) about 6 years ago

logger.rb: fix r43511 for Windows

  • lib/logger.rb (Logger::LogDevice::LogDeviceMutex#lock_shift_log): open file can't be removed or renamed on Windows. [ruby-dev:47790] [Bug #9046]
  • test/logger/test_logger.rb (TestLogDevice#run_children): don't use fork.

History

Updated by shyouhei (Shyouhei Urabe) about 6 years ago

  • Description updated (diff)

Updated by naruse (Yui NARUSE) about 6 years ago

The point "current implementation is wrong on multi-process environment" sounds reasonable and need to fix.

I commented some implementation points to the pull request.

#3

Updated by naruse (Yui NARUSE) about 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r43511.
Naotoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


Updated by nobu (Nobuyoshi Nakada) about 6 years ago

  • Status changed from Closed to Open
  • Priority changed from Normal to 5
  • % Done changed from 100 to 0

=begin
It broke on Windows.

  • don't use fork.
  • don't assume that open file can be removed or renamed.

I'll try to fix or revert it.
=end

#5

Updated by nobu (Nobuyoshi Nakada) about 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r43513.
Naotoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


logger.rb: fix r43511 for Windows

  • lib/logger.rb (Logger::LogDevice::LogDeviceMutex#lock_shift_log): open file can't be removed or renamed on Windows. [ruby-dev:47790] [Bug #9046]
  • test/logger/test_logger.rb (TestLogDevice#run_children): don't use fork.

Also available in: Atom PDF