AgFx
AgFx copied to clipboard
Unhandled exception from AgFx.ErrorLog.WriteError
I got this little watson report from my app using the latest AgFx source. Looking at the code for ErrorLog.WriteError, it looks like it should be protected from this (I think it would be an ObjectDisposedException). Has anyone else seen this or have any ideas?
Application_UnhandledException Cannot access a closed file. at System.IO.__Error.FileNotOpen() at System.IO.FileStream.Write(Byte[] array, Int32 offset, Int32 count) at System.IO.IsolatedStorage.IsolatedStorageFileStream.Write(Byte[] buffer, Int32 offset, Int32 count) at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) at System.IO.StreamWriter.Flush() at AgFx.ErrorLog.WriteError(String description, Exception ex) at AgFx.DataManager.OnUnhandledError(Exception ex) at AgFx.DataManager.<Get>b__7f[T](Exception ex) at AgFx.CacheEntry.NotifyCompletion(ValueLoader loader, Exception ex) at AgFx.CacheEntry.LiveValueLoader_Failed(Object s, ExceptionEventArgs e) at AgFx.CacheEntry.ValueLoader.OnLoadFailed(Exception ex) at AgFx.CacheEntry.ValueLoader.ProcessData() at AgFx.CacheEntry.LiveValueLoader.OnLoadSuccess(Stream result) at AgFx.DataManager.<>c__DisplayClass81`1.<>c__DisplayClass83.<Get>b__7c(LoadRequestResult result) at AgFx.WebLoadRequest.<>c__DisplayClass3.<>c__DisplayClass6.<Execute>b__1(IAsyncResult async) at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClassa.<InvokeGetResponseCallback>b__8(Object state2) at System.Threading.ThreadPool.WorkItem.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadPool.WorkItem.doWork(Object o) at System.Threading.Timer.ring()
Hi -
Yeah, as you can see from the code there's been a lot of fussyness with the IsoStore; it does random things.
I assume you can't repro this?
I'm not sure we really need to have those discrete catches in there, would be good to know the actual exception, but the real issue is that you've got a load case that's failing without an error clause - do you happen to know where that's happening?
I don't have any repro steps, and I'm not sure where I have a load without an error clause. I thought I'd tracked all of those down.
I have the change in a forked repository. I'm a github noob and want to send a pull request. I've got an earlier change in my fork that I don't want to to send your way (yet). In the page to send a pull request, I can change the commits from "master", but I don't know how to specify just one change. I can seem to put the id of a commit, but it's everything up to that point. I haven't been able to figure it out from the documentation. Any ideas?
Yes, I think GitHub is all or nothing. What you probably need to do is create a branch, merge over just the commit you want, then do the Pull Request from there. I haven't done too much of this either, so...
I have seen this issue using Agfx - I had a long unique key and I thought it was due to the "/" in the key but I now think it is the length of the key.
Perhaps storing the data in a DB of some form rather than encoding it into the file name would possibly alleviate the issue.
Yes, definitely possible it's due to the length of the encoded file name.
One option would be to have a strong hashing function to hash the UniqueName down to a shorter length.
Certainly pushing data into the DB is another option worth investigating now that 7.0 is pretty much out of the picture. The architecture is designed for this, it'd just be a matter of deriving another impl from StoreProviderBase and using that instead of the IsoStore implementation.