I have problems with intermittence in connection to mongodb since PHP 7.4. I don't understand why sometimes it fails to connect to ReplicaSet. What can I do ? I leave the log of my application below.
[18:58] [Worker 1] [109] Process with id 64bf99167c2a42530a2dbd97 has finished
[18:58] [Worker 1] [88] Start processing Process with id 64b920317c2a42530a2dbd72
[18:58] [Worker 1] [109] Process with id 64b920317c2a42530a2dbd72 has finished
[19:00] [Worker 1] [88] Start processing Process with id 64e61827874b0d115f5797d3
[19:00] [Worker 1] [109] Process with id 64e61827874b0d115f5797d3 has finished
[19:00] [Worker 1] [88] Start processing Process with id 64c37883921ed7598d54a694
[19:00] [Worker 1] [109] Process with id 64c37883921ed7598d54a694 has finished
[19:00] [Worker 1] [88] Start processing Process with id 64bf99167c2a42530a2dbd97
[19:00] [Worker 1] [109] Process with id 64bf99167c2a42530a2dbd97 has finished
[19:00] [Worker 1] [88] Start processing Process with id 64b920317c2a42530a2dbd72
[19:00] [Worker 1] [109] Process with id 64b920317c2a42530a2dbd72 has finished
[19:02] [Worker 1] [88] Start processing Process with id 64e61827874b0d115f5797d3
[19:02] [Worker 1] [109] Process with id 64e61827874b0d115f5797d3 has finished
[19:02] [Worker 1] [88] Start processing Process with id 64c37883921ed7598d54a694
[19:02] [Worker 1] [109] Process with id 64c37883921ed7598d54a694 has finished
[19:02] [Worker 1] [88] Start processing Process with id 64bf99167c2a42530a2dbd97
[19:02] [Worker 1] [109] Process with id 64bf99167c2a42530a2dbd97 has finished
[19:02] [Worker 1] [88] Start processing Process with id 64b920317c2a42530a2dbd72
[19:02] [Worker 1] [109] Process with id 64b920317c2a42530a2dbd72 has finished
[19:02] [Worker 1] [132] An error has ocurred on Process 64b920317c2a42530a2dbd72. Error Details: No suitable servers found (`serverSelectionTryOnce` set) on vendor/mongodb/mongodb/src/functions.php line 487 Trace: #0 vendor/mongodb/mongodb/src/functions.php(487): MongoDB\Driver\Manager->selectServer()
#1 vendor/mongodb/mongodb/src/Collection.php(687): MongoDB\select_server()
#2 libs/Mongodb/Collection.php(412): MongoDB\Collection->findOne()
#3 models/UserCollection.php(242): App\Libraries\Mongodb\Collection::findFirst()
#4 config/Injector.php(76): App\Collections\UserCollection::findFirst()
#5 models/CoreCollection.php(182): App\Collections\CoreCollection::getUser()
#6 models/ProcessCollection.php(454): App\Collections\CoreCollection->save()
#7 tasks/ProcessTask.php(112): App\Collections\ProcessCollection->save()
#8 [internal function]: App\Tasks\ProcessTask->App\Tasks\{closure}()
#9 vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AMQPChannel.php(1055): call_user_func()
#10 [internal function]: PhpAmqpLib\Channel\AMQPChannel->basic_deliver()
#11 vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(220): call_user_func()
#12 vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(374): PhpAmqpLib\Channel\AbstractChannel->dispatch()
#13 services/Queue/Worker.php(58): PhpAmqpLib\Channel\AbstractChannel->wait()
#14 tasks/ProcessTask.php(143): App\Services\Queue\Worker->consume()
#15 [internal function]: App\Tasks\ProcessTask->consumeAction()
#16 [internal function]: Phalcon\Cli\Dispatcher->callActionMethod()
#17 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->dispatch()
#18 run(27): Phalcon\Cli\Console->handle()
#19 {main}
[19:04] [Worker 1] [88] Start processing Process with id 64e61827874b0d115f5797d3
[19:04] [Worker 1] [109] Process with id 64e61827874b0d115f5797d3 has finished
[19:04] [Worker 1] [88] Start processing Process with id 64c37883921ed7598d54a694