|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58838 Unable to store columns: recv error after approx 200K inserts
Submitted: 2009-08-29 04:57 UTC Modified: 2009-09-04 04:06 UTC
From: Assigned:
Status: Closed Package: tokyo_tyrant (PECL)
PHP Version: 5.2.10 OS: Linux Centos 5.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2009-08-29 04:57 UTC]
I have a MySQL database with 250000 records which I try to 
convert to a Tokyo Cabinet Table database and I use this 
extension for that.

After approximately 200000 records get inserted, my code 
throws an exception "Unable to store columns: recv error". 
Further tries to insert throw the same exception. So it 
seems the socket cannot recv anymore.

I also tried with my own Tokyo Tyrant wrapper which is 
written in PHP and it works. So I think there might be 
something wrong in the extension regarding the way sockets 
are handled/released ?

It does the same thing whether connection is persistent or 

Reproduce code:
foreach ($pdo->query("SELECT * FROM message") as $row) {
    try {

    $msg = array();
    $msg['subject'] = $row['msg_subject'];
    $msg['from'] = mb_convert_encoding($row['msg_from'], 'UTF-8');
    $msg['date'] = $row['msg_date'];
    $msg['messageid'] = $row['msg_id'];
    $msg['list'] = $lists[$row['msg_fkmlist']];
    $msg['inreplyto'] = $row['msg_inreplyto'];
    $msg['body'] = mb_convert_encoding($row['msg_body'], 'UTF-8');
    $tt->put($row['pkmessage'], $msg);
    } catch (Exception $e) {

Actual result:
Unable to store columns: recv error


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-03 15:43 UTC]

the default timeout setting might be slightly too strict. Can you test the same code with following connect call:

$tt = new TokyoTyrant("youserver", 1978, array("timeout" => 5.0);

Does it get through the code?
 [2009-09-03 15:43 UTC]
Missing a closing ) there but you get the point :)
 [2009-09-04 02:45 UTC] php at mamasam dot net
That did the trick, thank you :)

Maybe we could add a new function to set the timeout and 
other options after the connection is opened, for example 
setTimeout() or setOptions()?

The documentation for the constructor and ::connect() is 
wrong for the last parameter :
 [2009-09-04 04:06 UTC]
Updated docs, added tune method to change timeout and disabled timeout by default.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu May 13 07:01:23 2021 UTC