On Thu, Mar 26, 2009 at 5:48 PM, Marvin Humphrey <[email protected]> wrote:
>> Got it. >> >> We just need to have SegReader wrap all of its calls to Architecture's >> factory >> methods in "try" blocks. Then, it can catch an exception, free itself, and >> rethrow for the benefit of higher level open call. It'll mean a bunch more >> silly private methods like SegReader_Try_Open_Lex_Reader() for the binding to >> implement, but that's the way it goes. > > I've gotten this working in KS. The retry logic doesn't leak any more when a > needed index file isn't found. If there's a fatal error due to a corrupt file > or something like that we still leak, but that doesn't matter. > > Turns out that SegReader itself didn't get significantly messier, and I was > actually able to reduce and simplify the host-specific code. Awesome! That was fast... > The big change was that Folder_Open_InStream, Json_slurp_json, Seg_Read_File, > and CFReader_new all had to start returning NULL upon failure rather than > throwing exceptions -- which meant the return values had to be checked for > each of those calls. It sure is nice you can still make such drastic changes :) Mike
