Modify ↓
Opened 10 years ago
Closed 10 years ago
#11904 closed defect (fixed)
Configuration.parse_if_needed takes forever to reload if clock is going back
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.5 |
Component: | general | Version: | 0.12-stable |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fix not reloading configuration if clock is going back. |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
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): 267 267 268 268 changed = False 269 269 modtime = os.path.getmtime(self.filename) 270 if force or modtime >self._lastmtime:270 if force or modtime != self._lastmtime: 271 271 self._sections = {} 272 272 self.parser._sections = {} 273 273 if not self.parser.read(self.filename):
Attachments (0)
Change History (4)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
comment:3 by , 10 years ago
Milestone: | next-stable-1.0.x → 1.0.5 |
---|---|
Owner: | set to |
Status: | new → assigned |
Thanks for the reviewing! I'll push it after release of 1.0.4.
comment:4 by , 10 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed in [13747-13748].
Note:
See TracTickets
for help on using tickets.
Looks good to me. Since
getmtime
returns anint
I can't see any issues with the not equals comparison.