When multiple threads in the same application attempt to connect to a server using a client-side authentication plugin, the following error can be observed from time to time.
Looking at the code in ma_client_plugin.c.in:
we see that something that can only occur with more than one thread is treated as an error. Additionally, it seems that the initial find_plugin() call is not done under the same lock under which the plugin loading is done. This would explain why more than one thread attempts to load the same plugin.
I believe that either the whole mysql_client_find_plugin should be covered by the same mutex or the already existing plugin should be returned instead of treating it as an error.