在运行Rails应用程序时,我经常遇到mongo错误:
W, [2023-04-15T04:40:34.178698 #102970] WARN -- : MONGODB | Detected PID change - Mongo client should have been reconnected (old pid 100659, new pid 102970
W, [2023-04-15T04:40:34.181347 #102970] WARN -- : MONGODB | Detected PID change - Mongo client should have been reconnected (old pid 100659, new pid 102970
W, [2023-04-15T04:40:34.181566 #102970] WARN -- : MONGODB | Detected PID change - Mongo client should have been reconnected (old pid 100659, new pid 102970
有谁知道是什么原因造成的?是不是超时设置太低了?
1条答案
按热度按时间g0czyy6m1#
看起来你在你的Rails应用中使用了一个forking服务器。在这种情况下,有必要在forking之后重新连接mongo客户端。在Mongoid文档中有一些例子