Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyStreamOutput freezes after 1 minute #74

Open
pavelsmolka opened this issue Apr 24, 2014 · 4 comments
Open

KeyStreamOutput freezes after 1 minute #74

pavelsmolka opened this issue Apr 24, 2014 · 4 comments

Comments

@pavelsmolka
Copy link

When I implement KeyStreamOutput and use it, it freezes after 1 minute:

class DeleteStream implements KeyStreamOutput {

    /** @var Bucket */
    public $bucket;

    public function __construct(Bucket $bucket) {
        $this->bucket = $bucket;
    }

    public function process($key) {
        echo "Deleting key $key\n";
        $this->bucket->delete($key);
    }
}

$bucket = $riak->getBucket('test');
$bucket->getKeyStream(new DeleteStream($bucket));

This example works for approximately 1 minute and then stops printing anything. Also, no more keys are deleted, after 1 minute. Is is possible Riak disconnects the connection and our library does not reconnects?

@pavelsmolka
Copy link
Author

I restarted my script couple of times. After a while, it worked just fine and deleted everything in the bucket. I wonder whether if there are too many keys, it fails, but if there are just several thousands, it finishes the job. In the last run, it took more than 5 minutes to stream all remaining keys and the script did not freeze.

@bachpedersen
Copy link
Contributor

php_riak will not auto retry stream or listkeys as they are very dangerous, but it should however throw an exception if something went wrong.

Now that I think about it I am unsure what happens if the process function throws an exception, I will check this when I get the time.

@bachpedersen
Copy link
Contributor

Does not look like a problem with exceptions not propagating, I have not been able to recreate it still.
Will try to recreate it using stress tests instead.

@guilhermeblanco
Copy link

Have you tried to check your default_socket_timeout PHP config? It may be the issue... =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants