[Haskell-cafe] Bug in HTTP (bad internal error handling)

Michael Snoyman michael at snoyman.com
Fri Oct 22 06:54:10 EDT 2010


On Fri, Oct 22, 2010 at 11:36 AM, Sigbjorn Finne
<sigbjorn.finne at gmail.com> wrote:
>
>
> On Fri, Oct 22, 2010 at 9:35 AM, Sittampalam, Ganesh
> <ganesh.sittampalam at credit-suisse.com> wrote:
>>
>> Bit Connor wrote:
>> > On Sat, Oct 16, 2010 at 10:29 AM, Claus Reinke
>> > <claus.reinke at talk21.com> wrote:
>> >>> After it catches this error, the function returns (line 376):
>> >>>
>> >>> return (fail (show e))
>> >>>
>> >>> The "fail" is running in the Either monad (The Result type =
>> >>> Either). This calls the default Monad implementation of fail, which
>> >>> is just a call to plain old error. This basically causes the entire
>> >>> program to crash.
>> >>
>> >>> Actually, it appears that simpleHTTP isn't actually supposed to
>> >>> throw an IOException, and it is instead supposed to return a
>> >>> ConnError result. So the real fix is to fix the code to make this
>> >>> happen. But
>> >>
>> >> Sounds like a victim of
>> >>   http://hackage.haskell.org/trac/ghc/ticket/4159
>> >>
>> >> For mtl clients, 'fail' for 'Either' used to call 'Left'. That was
>> >> changed, though the ticket does not indicate the library versions
>> >> affected.
>> >
>> > This looks like the problem. Any idea how to get the HTTP package
>> > fixed? I could try making a patch myself, but I would prefer hearing
>> > from the HTTP maintainer first, who doesn't seem to be around.
>>
>>
>> I've tried contacting him a few times about getting the base dependencies
>> in HTTP bumped and an upload made, without success. This is a widely used
>> package that's in the platform and that won't work with GHC 7.0 with the
>> current dependencies, so it really needs to get fixed soon.
>>
>> libraries@, what's the right way to proceed? Can I make a Debian-style
>> "non-maintainer upload" with minimal changes to fix urgent issues like
>> these?
>
> I'd be much obliged if you could, and I do apologise for leaving all of this
> just hanging.
> No time available for Haskell projects these days unfortunately, Opera
> engine development taking up most of my waking hours. Getting someone to
> take over HTTP would be best, or maybe rewrite it altogether..it is not the
> prettiest thing around :)

I know it may not be appropriate as-is due to its dependency list, but
http-enumerator[1] may be something to consider. It's still young, but
I think the API is pretty clean, and I've heard from users that it
performs favorably versus HTTP.

Michael

[1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/http-enumerator


More information about the Libraries mailing list