|
No, just lots of Scotch!
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
That remark kilt me - well plaid !
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Is that a sample of the "no true Scotsman"" argument?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
|
Yes, I encountered it numerous times on numerous different machines, despite them all having a UPS to ensure a clean shutdown on power failure.
I created a ConfigurationUncorrupter class. It detects when an app startup is complete and configuration has been successfully loaded then it creates a safe copy of the config file. If, on the other hand, loading configuration fails, it replaces the config file with the backup from the last successful start and tries again.
Every app gets that class incuded. That has pretty much eliminated the problem for me.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
I like that idea a lot, as part of a belt-and-suspenders system.
But this begs the question, I'd be very curious to know what happens so frequently and in such a repeatable fashion that such a thing had to be written in response to this recurring situation.
I mean, a config file is typically something that should be read (in read-only mode) at startup and then closed and left alone. Then even if the system isn't shut down cleanly, that config file should be safe. The only time it should be at risk is when it's opened to write new data into it or edit existing data. What gets it corrupted so easily?
And I hope that when your Uncorrupter class knows it has to intervene and restore the config file from a backup, it logs everything it possibly can to try to narrow down any potential source. Because that's not a "normal" state of operation. I'd be very uncomfortable knowing this auto-restore code gets triggered on a regular basis without understanding why.
|
|
|
|
|
Yes, it does all the appropriate logging.
The problem only occurs on startup and I'm sure it's not caused by any of my code. My code never explicitly writes to the config file. I have a much more complex, multi-application, shared configuration system that doesn't suffer from the same problem. It's only the very simple, standard, AppName.exe.config file that is ever affected.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
Gotcha.
I wasn't trying to blame your code, and the fact that others have reported the same problem doesn't surprise me. That pretty much rules yours out.
So given those circumstances, I think you're doing exactly the right thing - it's out of your control, but you anticipate it and do the best to recover gracefully given the circumstances. And you log it so you know when it happens. So you should have all the ammunition you need when someone tries to place some blame.
|
|
|
|
|
Thanks. I didn't think you were blaming me; I just wanted to be clear for the sake of others encountering the same problem.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
|
Verb?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
This thread is almost like CCC:
The - article
s**t - expletive
happens - verb
Mircea
|
|
|
|
|
Part of me is thinking this is a wind-up, right? I mean; power goes off, computer dies; and with the last few spare electrons the dedicated "XML File Writer" chip is enabled and the special write-only head on the slowing diskdrive momentarily lights up to zap the file to all zeros. Or wait, does it convert them to spaces? Or re-write the entire file removing the data between the XML tags? But surely it also needs to adjust the sectors after the end-of-file, or maybe even move the file elsewhere, which means updating the FAT, which means knowing where it is... Man, that chip has some pretty intense logic hard-wired into it.
But seriously; a power failure causing a specific type of file to have a specific type of corruption written to it?
However, having read that SO issue, it does begin to sound like there is some logic to it. All I can say is that in 25 years of using Windows, with a fair number of power failures and OpSys crashes along the way, I'm not aware of such a situation arising, ever. That's not to say it hasn't; maybe the software has corrected itself or maybe I've never needed to access affected files. That XML configuration files are frequently the victims, though, suggests to me that there is something in the CLR that is inappropriately readying the XML file for a write FAR too soon. This smacks of just really poor design within the MS subsystem, or an actual bug. This doesn't surprise me.
Thank for highlighting it here!
|
|
|
|
|
It might also have to do with the complicated way the settings are written by several applications to the same config file. We use Mutexes to prevent applications accessing this file at the same time.
In the past the applications just wrote to their own config file, but it was decided that everything should be written to the same file ...
|
|
|
|
|
See my reply to dandy72, above.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
Years ago, I ran into something similar with compiles. I eventually tracked it down to "endpoint" software which would "see" a change and try to back up files that would stop them from being written correctly.
|
|
|
|
|
Rivers of Nihil - The Silent Life[^]
This week's SOTW is from Rivers of Nihil, who are releasing their new album, The Work, next week (out on the 24th!).
Funny thing, some years ago, YouTube recommended me some of their songs and I listened to them and for some reason I filed it under "soft rock" (and so never listened to it again).
Then two weeks ago, I read an interview with them and they said they play modern death metal with various influences.
So I decided to give it another listen and you can say a lot about Rivers of Nihil, but not that they are soft
I really don't know why I made that conclusion all that time ago.
Anyway, looking forward to their upcoming album now.
Also gave their previous album, Where Owls Know my Name, a listen and it's very much worth it!
And as such, this week's SOTW is from that album.
There's a nice twist at 3:20
|
|
|
|
|
I listened to this one all the way through. While I'm not a fan of the growling (pretty much indecipherable) vocals, I understand it to be a hallmark of death/black metal. The musicianship is very good, especially the double-bass. Indeed, that is a nice twist in the middle...my favorite part.
BTW, thank you for your weekly picks. It's something I look forward to every Friday!
Also, since I believe it's a shame not to share good music (subjective) I thought I'd share what I think is one of the best metal concept albums (cover to cover) ever released.
Symphony X - V:The New Mythology Suite - Bing video[^]
"Go forth into the source" - Neal Morse
"Hope is contagious"
|
|
|
|
|
Good, their music is quite complex and there are engaging moments, but it's not my cup of tea ... In the past they could create heavier moods I think, for instance The Walls of Babylon - YouTube
|
|
|
|
|
|
|
A good one ... best part starts at 1:15, I nearly started jumping around ...
But, I have still work to do ... Cheers,
|
|
|
|
|
Nice one.
There used to be a local punk band here named the Cenobites.
I may or may not have seen them back in my day and I may or may not know these guys who may or may not went to my school
Anyway, thought of them: CENOBITES - Murderer's fate[^]
I like your Cenobyte A LOT better though
|
|
|
|
|
Nice ... there is indeed a nice style transition around 3:20 and, later on, a great DM part around 4:30 with really good vocals there. I didn't pay attention to Rivers of Nihil either, thus .. note taken . And, in spite of very busy days on my side, I lately rediscovered Fear Factory ... wonderful stuff 540,000 Degrees Fahrenheit - YouTube. Checking their latest album as we speak ...
|
|
|
|