In R, the database is written using multithreading, and in the local Linux environment, there is always a problem with insufficient threads. In the Windows environment, it does not appear.
Personal conjecture is due to the maximum number of connections that ODBC has limited under window, so it does not exceed the maximum number of connections to the database, so there is no problem with multithreading running under window.
Under local Linux, there is no limit due to local direct connection. When the program is blocked, it will not stop generating new threads to connect the database, it is easy to reach the max_connection of the database, causing the server to run the script at the time of insufficient thread.
Subsequent considerations limit the number of threads in the script, and no new threads are generated when a value is reached;
On the other hand, you can also consider limiting the number of connections that are generated. And then we'll see if this problem will happen again.
For scenarios that limit the number of connections, refer to MARIADB to view the system connection commands:
Http://www.linuxidc.com/Linux/2016-05/131027.htm
MARIADB Multi-threaded connectivity issues