thobbs/phpcassa — Issue #54: Recursing too deep in ColumnFamilyIterator->next()
Author: maxwheeler
Created: 2011-11-30 19:33:35+00:00
State: open

If a CF query results in many empty (tombstone) rows then next() will call itself too many times and fault with the following error.

Fatal error: Maximum function nesting level of '100' reached, aborting! in /util/phpcassa/columnfamily.php on line 1222

Call Stack:

0.1746 10349728 5. ColumnFamilyIterator->next() /util/phpcassa/columnfamily.php:1231
0.1746 10349864 6. ColumnFamilyIterator->next() /util/phpcassa/columnfamily.php:1231
0.1746 10350000 7. ColumnFamilyIterator->next() /util/phpcassa/columnfamily.php:1231

The problem occurs on line 1229 below:

if (count(current($this->current_buffer)) == 0)
{
# this is an empty row, skip it
$key = key($this->current_buffer);
$this->next();
}
When there are lots of empty rows $this->next() keeps getting called until it goes too deep and dies.