Opened 13 years ago
Closed 13 years ago
#10249 closed Bug Report - General (Duplicate)
config.xml gets truncated due to race condition when rewriting it on every application run
Reported by: | Owned by: | sphery | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | MythTV - General | Version: | Master Head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
Symptom in any logfile:
2012-01-09 21:56:59.715916 E Error parsing: /home/mythtv/.mythtv/config.xml at line: 1 column: 1 2012-01-09 21:56:59.715921 E Error Msg: unexpected end of file
See the diagnosis between 18:00 and 21:00 at http://irc.mythtv.org/ircLog/channel/4/2011-12-29:18:05
It appears that every application rewrites the config file on every run which can lead to silent truncation when the application is killed at the right time.
Possible solutions:
- only write the config file when it has been changed
- rewrite the config writing to make the race condition impossible (like writing to tempfile and move that over the old one)
Change History (2)
Note: See
TracTickets for help on using
tickets.
This will be handled as part of #10305 . Patch attached there ensures that we only re-write config.xml when it changes.