PSA: using MySQL from Haskell programs

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...

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... _______________________________________________
Interestingly a similar issue was posted recently on Hacker News: http://news.ycombinator.com/item?id=1661986 Cheers, G

-----BEGIN PGP SIGNED MESSAGE----- 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...
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@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyGz6wACgkQIn7hlCsL25WargCeKQp4iEMO6y036eFCleertO10 KeEAoK3B9kpVinNWlSnUprAwcAAPtCAI =Yd6E -----END PGP SIGNATURE-----
participants (3)
-
Brandon S Allbery KF8NH
-
Bryan O'Sullivan
-
Gaius Hammond