Edgewall Software

Opened 6 years ago

Last modified 6 years ago

#11904 closed defect

Configuration.parse_if_needed takes forever to reload if clock is going back — at Version 1

Reported by: Jun Omae Owned by:
Priority: normal Milestone: 1.0.5
Component: general Version: 0.12-stable
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Jun Omae)

Configuration.parse_if_needed() reload only when the file is modified by checking that its modified time is greater that saved modified time.

However, if system clock is going back (e.g. by ntpdate), it would take forever to reload.

I think we should check difference between current and saved modified times.

  • trac/config.py

    diff --git a/trac/config.py b/trac/config.py
    index 7b233d5..41932e6 100644
    a b class Configuration(object):  
    268268        changed = False
    269269        modtime = os.path.getmtime(self.filename)
    270         if force or modtime > self._lastmtime:
     270        if force or modtime != self._lastmtime:
    271271            self._sections = {}
    272272            self.parser._sections = {}
    273273            if not self.parser.read(self.filename):

See [c4561077/jomae.git] (log:jomae.git@t11904).

Change History (1)

comment:1 by Jun Omae, 6 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.