You are here: Foswiki>Tasks Web>Item12712 (05 Jul 2015, GeorgeClark)Edit Attach

Item12712: Foswiki loggers should obtain file lock before writing

pencil
Priority: Normal
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component: FoswikiLogger
Branches: trunk
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
It's possible that log records can get lost if multiple threads try to log at the same time.

This could possibly slow things down a bit due to contention on the logfile. LogDispatch provides a solution by optionally incorporating the pid into the logfile name, at the expense of loosing the eachEventSince() function.

-- GeorgeClark - 07 Jan 2014

The outstanding issue here is probably the PlainFile log rotation code, which makes no attempt to lock while doing the log rotation. I tried to rewrite it a couple of different ways, and ran into issues. One issue is that the unit tests have issues with how they create logfiles for eachEvent merge testing..

One other thing to check: There are comments in Store that flock is not portable, however the notes in perlport states:

flock

Not implemented (VMS, RISC OS, VOS).

I'd be really surprised if any web server is running on these old OS implementation.

-- GeorgeClark - 17 Jun 2014
 

ItemTemplate edit

Summary Foswiki loggers should obtain file lock before writing
ReportedBy GeorgeClark
Codebase 1.1.9, trunk
SVN Range
AppliesTo Engine
Component FoswikiLogger
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:2da6fd13195b
TargetRelease major
ReleasedIn 2.0.0
CheckinsOnBranches trunk
trunkCheckins distro:2da6fd13195b
Release01x01Checkins
Topic revision: r6 - 05 Jul 2015, GeorgeClark - This page was cached on 11 Dec 2016 - 05:12.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License