On Tue, Oct 25, 2016 at 10:53:19PM +0200, Yuri D'Elia wrote:
> I'm running mbsync as part of a cron job under timeout(1).
> I sometimes get the following:
> 
> Error: incomplete journal entry at /path.journal:2
> 
> where the journal file looks simply truncated (probably not flushed).
> The actual file content is:
> 
> 00000000: 320a 0000 0000 0000 0000 0000 0000 0000  2...............
> 00000010: 0000 0000 0000 0000 0000 0000 0000       ..............
> 
> I remember asking in the list how robust the journal mechanism, but it
> doesn't seem reliable enough for mbsync to be SIGTERM'ed/interrupted.
> 
that doesn't make sense to me. a signal may not alter what gets written
to the file, only how much of it is written. zero-padding may only
happen as a response to internal inconsistency, which a sane kernel
positively will not introduce itself just because something interrupted
a userspace process.
maybe you can strace your cron job to see what is happening.

> This is compounded by the fact that I cannot easily distinguish a
> network error (that I want to ignore - as it's generally transient) from
> an mbsync's internal error such as this.
> 
i'm collecting error messages and grepping them. that way i filter out
all the silly noise from outlook.
getting proper exit code handling is kinda tough, because mbsync can
perform multiple independent jobs - do you report the best or the worst?
i guess it would be possible to write a precise report file with one
line per mailbox. however, undoubtedly the best solution would be
letting mbsync handle transient errors and the timing itself.

------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to