[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coldsync-hackers] Reporting conduit errors



On Thu, Sep 18, 2003 at 02:29:18PM -0600, John Deptuch wrote:
> On Wednesday 17 September 2003 03:52 pm, Andrew Arensburger wrote:
> > 	Agreed. Let's call it a missing feature.
> > 	With Fetch and Dump conduits, you should be able to get away with
> > 		die "501 blah"
> > but I wouldn't recommend that for Sync conduits.
> 
> What would the be the correct way of exiting from a conduit when an error is 
> encountered?  Most of the examples that are in the conduits directory that 
> come with the CVS version of the coldsync use die.

	As you've no doubt figured out by now, ColdSync communicates
with conduits on their stdin/stdout. It looks at the last status
message printed before the conduit exits, and uses that as the return
code for determining whether the conduit exited with an error or not.
	If you have a Fetch or Dump conduit, then there's really
nothing to do once you've found an error, so (for now) it's okay to
use 'die'.
	However, it's cleaner to exit with &EndConduit, since in the
future there might be other things to clean up before exiting, even if
there's an error. But &EndConduit doesn't (yet) allow you to exit with
a status other than "201 Success". So the perl/ColdSync.pm code needs
to be fixed.

> >         Secondly, ColdSync does read all of the status messages from the
> > conduit, but doesn't do anything with them (I did see a comment in there
> > that says,
> >                /* XXX - Do something intelligent */
> > so I guess this is a Known Issue).

> Do you know if this is planned?

	Sorta-kinda. It's an XXX comment, which means that it's
something that should be fixed. These days, however, I'm not doing
much work on ColdSync, and Alessandro's the release manager and
overall boss, so it's really up to him to decide whether this is a
good thing.
	Personally, I think it would be worth adding. But as things
stand, it probably won't get added until you submit a patch (open
software progresses when developers fix the things that annoy them,
and it sounds as if you're the one most annoyed by this problem right
now).

> If not Alessandro Zummo had suggested using 
> dlp_AddSyncLogEntry to add a note to the hotsync log but that seems to only 
> be valid for sync flavour conduits

	Correct.

> and I really need a fetch dump flavour 
> conduit.  So is it possible to allow dlp_AddSyncLogEntry to function in a 
> dump or fetch conduit?

	No, dlp_AddSyncLogEntry won't do anything with a Fetch or Dump
conduit, since the Palm might not even be connected at the time.

	Hurm. Now that I think about it, I'm not entirely sure how to
fix this. The problem is that notionally, the Palm need not be
connected when you're running a Fetch conduit (in fact, it would be
cool to have a utility that runs all of your Fetch conduits once an
hour, so that you don't have to run them while syncing). And the Palm
is definitely not connected when the Dump conduits run. So there's no
way to report these errors on the Palm.
	So I suppose the most sensible thing to do would be to collect
conduits' error messages during Install and Fetch conduits into a
variable-sized buffer, and upload that buffer to the PDA's log in the
initial part of the "main" sync. As for errors during Dump conduits,
perhaps the only reasonable thing to do is to mail them to the user.
	Any thoughts?

-- 
Andrew Arensburger                      This message *does* represent the
arensb@ooblick.com                      views of ooblick.com
  Don't Panic! It's all right. Everything is going to be just fine.
This message was sent through the coldsync-hackers mailing list.  To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body.  For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.