Partial stacktrace from some of our earlier debugging -- how we found it:

#0  0x0000003a678e9190 in shutdown () from /lib64/libc.so.6
#1  0x0000003451a56e06 in vio_close () from /usr/lib64/mysql/libmysqlclient_r.so.16
#2  0x0000003451a5683e in vio_delete () from /usr/lib64/mysql/libmysqlclient_r.so.16
#3  0x0000003451a52962 in end_server () from /usr/lib64/mysql/libmysqlclient_r.so.16
#4  0x0000003451a54bee in cli_advanced_command () from /usr/lib64/mysql/libmysqlclient_r.so.16
#5  0x0000003451a52a7a in mysql_close () from /usr/lib64/mysql/libmysqlclient_r.so.16
#6  0x00007fffefde8059 in nogvl_close (wrapper=0x13103c0) at ../../../../ext/mysql2/client.c:190
#7  decr_mysql2_client (wrapper=0x13103c0) at ../../../../ext/mysql2/client.c:205
#8  0x00007fffefde924c in rb_mysql_result_free (ptr=0x1419c50) at ../../../../ext/mysql2/result.c:88
#9  0x00007ffff7c01961 in run_final () at gc.c:1415
#10 finalize_list () at gc.c:1429
#11 finalize_deferred () at gc.c:1450
#12 rb_gc () at gc.c:3112