There’s a certain ancient Java library that I sometimes use from
JRuby, and I’ve noticed that when it fails, JRuby exits silently with
an exit value of 1. begin…rescue…end doesn’t capture it, and the
at_exit proc isn’t executed. I’ve noticed this bug probably since the
1.5 series up to 1.6.7, in 1.8 and 1.9 modes.
The Java library in question is mysql-je – a barebones library that
can do basic MySQL access using local files (using the same layout and
format as the files in an actual MySQL server). The error occurs when
the database files are read-only or opened by another process. I know
there are other, better, ways to access on-disk databases; my purpose
is just to point out this bug, since I think JRuby should be able to
handle a failure in an external jar.
What more information can I provide to help debug it? The library
depends on a native MySQL library for Linux, Mac OS X, or Windows. I
believe I have all three libraries (in 32-bit only except for Linux),
along with the jar, but I’m not sure where I can upload them (or
whether anyone would trust binaries I supply). I suppose I could ask
that others build the native libraries from source, but I had trouble
even finding the right MySQL version, and didn’t document the build
process as I should have.