While trying to send multiple commands using Redis::PIPELINE mode in multi function, the publish function ended up in segmentation fault.
While the message gets published to the channel the script ends immediately with a Segmentation Fault
<?php
function executePipelineCommands($redisConnection,$commands){
$pipeline = $redisConnection->multi(Redis::PIPELINE);
foreach($commands as $command){
$function = array_shift($command);
call_user_func_array (array (&$pipeline, $function), $command);
/* if($function == "publish"){
$redisConnection->publish($command[0],$command[1]);
}
*/
}
$pipeline->exec();
}
$redisConnection = new Redis ();
try {
$redisConnection->connect ( "127.0.0.1",6739, 0.3 );
} catch ( RedisException $re ) {
}
$redisConnection->publish("PubChannel","message1"); //executes correctly
$commands[] = array("set",'key2', "val2");
$commands[] = array("publish","PubChannel","sd"); // SEG FAULT after this is executed and script ends
$commands[] = array("set",'key3', "val3");
$commands[] = array("zIncrBy",'SSet',10,"val4");
$commands[] = array("publish","PubChannel","message2");
executePipelineCommands($redisConnection,$commands);
?>
While trying to send multiple commands using Redis::PIPELINE mode in multi function, the publish function ended up in segmentation fault.
While the message gets published to the channel the script ends immediately with a Segmentation Fault