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 Initial Version

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

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):  
    267267
    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 jomae.git@t11904.

Change History (0)

Note: See TracTickets for help on using tickets.