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

Re: [MirageOS-devel] load/startup time error handling

  • To: Hannes Mehnert <hannes@xxxxxxxxxxx>
  • From: Anil Madhavapeddy <anil@xxxxxxxxxx>
  • Date: Tue, 4 Oct 2016 12:04:52 +0100
  • Cc: mirageos-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 04 Oct 2016 11:05:06 +0000
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=recoil.org; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; q=dns; s= selector1; b=fwwYBjT8GhkY3c21hg2VSGw29mp5264ak4w9rJXceNGbZrMlcw/ HYrl2nxgP6PoMKXfOpAc1lai4Bvh5WoAXvTm3972vGYz04IrHEeltwSiUABB2+1c 2tIM8wk2SjjvJkkXbLZ8TNdygbULB14M/HhGAUOSJqe1z0S3lwU+Ytfg=
  • List-id: Developer list for MirageOS <mirageos-devel.lists.xenproject.org>

On 1 Oct 2016, at 21:49, Hannes Mehnert <hannes@xxxxxxxxxxx> wrote:
> On 30/09/2016 17:13, Hannes Mehnert wrote:
>> If nobody disagrees (and comes up with non-contrived examples), I'm
>> happy to massage code into this direction within the next few days.
> Thanks for the feedback, I prepared a bunch of PRs linked from
> https://github.com/mirage/mirage/pull/602 .  Lots of CI failures are due
> to the fact that the repository needs to pin another library, thus they
> should solve themselves.  I built most of the packages (esp tcpip,
> mirage-block-xen&unix) locally and run the testsuites successfully.
> Of special interest might be the PR to mirage-platform and mirage-solo5,
> which catch the exception from startup and emit a log message to Logs.err.
> Since this is a change affecting lots of repositories, it would be great
> to have this change merged rather sooner than later (mirage-dev likely
> needs to be extended with some of these packages).  If anyone is up for
> merging & adjusting mirage-dev, feel free to do so, I need some sleep.

I've started porting some of the fallout from this (e.g. qcow-format), and
immediately ran into some of the other module types such as FLOW.write
returning polymorphic `Error|`Ok pairs.

So this leads me to wonder if we shouldn't just bite the bullet and port
all these interfaces to use Rresult [1] combinators instead.  It does provide
excellent support for propagating errors, and combinators for mapping
over result types quite conveniently.  In the case of connect, if we made
it a `('a,'b) result io` return value we would end up with a nice ready-made
error string that can be printed, instead of having to catch the Lwt.fail
exception and turn it into a string ourself.

It would be a lot of breakage in the short term and probably delay the
release by a couple of weeks, but in return it would significantly increase
the succinctness of code (particularly in the filesystem layer).


[1] http://erratique.ch/software/rresult/doc/Rresult.html


MirageOS-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.