[Haskell-cafe] PSA: using MySQL from Haskell programs

Brandon S Allbery KF8NH allbery at ece.cmu.edu
Tue Sep 7 19:50:04 EDT 2010

Hash: SHA1

On 9/7/10 14:43 , Gaius Hammond wrote:
> On 7 Sep 2010, at 18:46, Bryan O'Sullivan wrote:
>> If you are using HDBC-mysql or HDBC-odbc to access MySQL databases, you
>> may have run into problems with your programs failing due to connection
>> errors. In this blog posting, I describe what's happening and how to work
>> around it:
>> http://www.serpentine.com/blog/2010/09/04/dealing-with-fragile-c-libraries-e-g-mysql-from-haskell/
> Interestingly a similar issue was posted recently on Hacker
> News: http://news.ycombinator.com/item?id=1661986

BSD (CSRG) UNIX had restartable system calls (no EINTR except from select(),
which you had to use if you wanted to be interruptible under some
circumstances which I'm not recalling off the top of my head right now; more
than a few programs that didn't follow the rules turned out to not support
any kind of interruptibility until rewritten to use select()).  AT&T
commercial UNIX kept the original Research Edition UNIX EINTR semantics.
POSIX had to reconcile them; the decision was to go with EINTR (you can
simulate restartable system calls by looping on EINTR, but if restartable
system calls are the default the only way to escape them is to rewire the
program to use select() as above) but systems could offer sigaction() flag
SA_RESTARTHAND to enable system call restarting on a signal-by-signal basis.
 (Note that SA_RESTARTHAND is not required for compliance, but a compliant
system with SA_RESTARTHAND must have compliant semantics for it or call it
something else.)

- -- 
brandon s. allbery     [linux,solaris,freebsd,perl]      allbery at kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university      KF8NH
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


More information about the Haskell-Cafe mailing list