mysql
mysql copied to clipboard
Make ffi calls interruptible
GHC 7.8 brought interruptible FFI. This might be very useful sometimes, especially upon hanging request through FFI. Some more context on a reddit thread.
What do you think? Would that be a good thing to have? Should mysql support GHC >=7.8 or would adding such thing require doing ifdefs to support older GHCs as well? Thanks.
If I understand it correctly custom SIGPIPE
handler is needed - https://dev.mysql.com/doc/refman/5.7/en/c-api-threaded-clients.html
Don't safe
FFI calls also allow interruption? I'm pretty sure that's already happening here.
@3noch Austin Seipp talks about it explicitly in the post linked above
@qrilka I see. Right now I think the C code is just blocking RTS signals: https://github.com/paul-rouse/mysql/blob/master/cbits/mysql_signals.c#L28-L32
@3noch but only SIGALRM
and SIGVTALRM
are blocked.
MySQL docs say:
To use your own SIGPIPE handler, first call mysql_library_init(),
then install your handler.
I have tried unblocking SIGPIPE
before doing a test query but the signal doesn't get through.
@paul-rouse could we know your opinion on this issue?
Sorry, I'm not ignoring this, but I have a work deadline - I'll give it proper thought soon!