无法在x毫秒内从套接字读取x个字节

时间:2016-01-23 23:23:26

标签: php mongodb php-mongodb

任何人都可以解释这意味着什么以及我能做些什么呢?

Failed to read 4 bytes from socket within 300000 milliseconds

使用MongoDB的新PHP驱动程序批量写入MongoDB时,它会一次又一次地发生。完整的错误消息是:

Fatal error: Uncaught exception
'MongoDB\Driver\Exception\ConnectionTimeoutException' with message 'Failed to
send "insert" command with database "bibliographic": Failed to read 4 bytes
from socket within 300000 milliseconds.' in /var/www/html/bms/functions.php:143
Stack trace: #0 /var/www/html/bms/functions.php(143):
MongoDB\Driver\Manager->executeBulkWrite('bibliographic.d...',
Object(MongoDB\Driver\BulkWrite)) #1 /var/www/html/bms/webpages/import.php(13):
parseMARC21XMLfile('../../DNB-Titel...', 'mongodb', '', '', '',
'bibliographic.d...') #2 {main} thrown in /var/www/html/bms/functions.php on
line 143

我尝试使用PHP的usleep()函数使脚本变得更慢,这似乎是解决了#34;问题。但是剧本要慢一点..谢谢!

0 个答案:

没有答案