Any code that follows the pattern "allocate bare resource using a function imported from C, then create a foreign pointer that manages the resource" needs to mask asynchronous exceptions, since if exception arrives between allocation and wrapping, memory leaks. This is particularly dangerous in connectdb, since such code may eventually run out of reachable database connections, completely blocking the access to the database.