Re: Chunking throwing IOException

"Justin T. Sampson" <[email protected]> Sun, 16 Jun 2013 19:33:35 -0700
Newsgroups gmane.comp.java.prevayler
Message-ID <CAAshuuEY6PwoSuSEgLMGZw3_USZtcXSsYHcT5ip198J6W6An9A@mail.gmail.com>
It looks like DurableInputStream has some code to ignore stream corruption
by catching exceptions, so it's appropriate for Chunking to throw an
exception.

Looking at DurableInputStream with the "blame" view in GitHub, it appears
that those catch clauses predate my Chunking code, so the exceptions being
caught might not be relevant anymore.

On the other hand, I would question the idea of ignoring stream corruption.
If a chunk was *incompletely* written, Chunking.readChunk throws an
EOFException, which *will* be ignored. The exception you're actually seeing
indicates that data *was* written, but was somehow corrupted rather than
merely truncated.

Have you taken a look at the journal file to see what the corruption looks
like? It would be nice to figure out how it happened rather than ignoring
it.


On Sun, Jun 16, 2013 at 3:37 PM, Klaus Wuestefeld <[email protected]> wrote:

> Hi,
>
> Prevayler is throwing an IOException at startup when a chunk header is
> corrupted.
>
> Could this be caused by the last chunk not being written properly?
> In this case, shouldn't Prevayler ignore the broken chunk?
>
> Klaus
>
>
> Caused by: java.io.IOException: Chunk header corrupted
> at org.prevayler.foundation.Chunking.readChunk(Chunking.java:59)
> at
> org.prevayler.foundation.DurableInputStream.readChunk(DurableInputStream.java:38)
> at
> org.prevayler.implementation.journal.PersistentJournal.recoverPendingTransactions(PersistentJournal.java:169)
> at
> org.prevayler.implementation.journal.PersistentJournal.update(PersistentJournal.java:142)
> at
> org.prevayler.implementation.publishing.CentralPublisher.subscribe(CentralPublisher.java:98)
> at
> org.prevayler.implementation.PrevalentSystemGuard.subscribeTo(PrevalentSystemGuard.java:45)
> at org.prevayler.implementation.PrevaylerImpl.<init>(PrevaylerImpl.java:47)
> at org.prevayler.PrevaylerFactory.create(PrevaylerFactory.java:289)
>
> --
> Valeu, Klaus.
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> To unsubscribe go to the end of this page:
> http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
> _______________________________________________
> "Databases in Memoriam" -- http://www.prevayler.org
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

_______________________________________________
To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
_______________________________________________
"Databases in Memoriam" -- http://www.prevayler.org